Field Staff Tracking
Scheduler & Background Jobs
Punch Timing Processor

Punch Timing Processor

The AttendancePostService is a Windows Service that runs as a background job, processing mobile punch timing records into the daily attendance system. It uses Quartz.NET for scheduling and runs every 30 seconds during working hours.

Processing Flow

Quartz.NET Configuration

SettingValueDescription
Job Namejob1Job identity
Job GroupPunchTimingsJobJob group name
Trigger Nametrigger1Trigger identity
Cron Expression0/30 * 7-23 * * ?Every 30 seconds, 7 AM to 11 PM

Cron Expression Breakdown

FieldValueMeaning
Seconds0/30Every 30 seconds
Minutes*Every minute
Hours7-237 AM to 11 PM
Day of Month*Every day
Month*Every month
Day of Week?Any day of week

The service is dormant from 11 PM to 7 AM, reducing unnecessary processing during non-working hours.

Service Lifecycle

The service performs a graceful shutdown with sched.Shutdown(true), waiting for any in-progress jobs to complete before stopping.

Logging

The service logs key events:

EventLog Message
Startup"Punctime processor job : Successfully started."
Shutdown"Punchtime processor Job : Successfully stopped."
Start Error"Punchtime processor job : Error while initiating scheduler."
Stop Error"Punchtime processor Job : Error while shutting down the scheduler."
Job ErrorException logged via Scheduler.Logger.WriteLog(ex)

Logs are written to the Log\Scheduler directory.

Source Files

FilePurpose
AttendancePostService.csWindows service entry point
Models/Scheduler.csQuartz.NET scheduler + PunchTimingsJob
Models/AttendanceDataManager.csPostRecords business logic
Models/EmployeePunchTimings.csPunch timing data model