All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
2.1.3 - 2024-12-29
- Composer
- Allow PHP 8.4
2.1.2 - 2024-07-03
ProcessJobExecutor
- start and end times passed from job process to main process are not shifted by offset of current timezone from UTC
ListCommand
- handle impossible due times (like 31st of February)
2.1.1 - 2024-06-21
- callbacks are marked as either
@param-later-invoked-callable
or@param-immediately-invoked-callable
- Allow PHP 8.3
- Allow symfony/console, symfony/lock and symfony/process ^7.0.0
2.1.0 - 2024-05-26
ManagedScheduler
- warns in case lock was released before job finished (via optional logger)
ExplainCommand
- explains cron expression syntax
ListCommand
- adds
--explain
option to explain whole expression
- adds
SymfonyConsoleJob
JobInfo
getTimeZone()
returns timezone job should run inisForcedRun()
returns whether job was run via $scheduler->runJob() or scheduler:run-job command, ignoring the cron expression
PlannedJobInfo
getTimeZone()
ProcessJobExecutor
- subprocess errors include exit code
- logs unexpected stdout instead of triggering E_USER_NOTICE (via optional logger)
- logs unexpected stderr instead of throwing an exception (via optional logger)
JobInfo
getExtendedExpression()
includes seconds only if seconds are usedgetExtendedExpression()
includes timezone if timezone is used
ListCommand
- more compact render
- sort jobs by keys instead of generated names
WorkerCommand
- requires interactive CLI
--force
option to bypass interactive CLI requirement
ListCommand
- on invalid input option - writes error to output instead of throwing exception
JobInfo
getStart()
includes correct timezone (in main process, when usingProcessJobExecutor
)
JobResult
getEnd()
includes correct timezone (in main process, when usingProcessJobExecutor
)
2.0.0 - 2024-01-26
This release most notably contains:
- planning jobs by seconds
- timezones support
- locked job, before run and after run events
- job results are shown in console immediately
- stderr handling in subprocesses - causes an exception
- stdout handling in subprocesses - causes a notice, instead of an exception
- simplified job manager
Scheduler
runPromise()
- allowsscheduler:run
andscheduler:work
commands to output job result as soon as it is finished
SimpleScheduler
addJob()
accepts parameterrepeatAfterSeconds
addJob()
accepts parametertimeZone
addLazyJob()
replacesCallbackJobManager
ManagedScheduler
addLockedJobCallback()
- executes given callback when job is lockedaddBeforeRunCallback()
- executes given callback before run startsaddAfterRunCallback()
- executes given callback when run finishes
JobInfo
getRepeatAfterSeconds()
- returns the seconds part of expressiongetExtendedExpression()
- returns cron expression including secondsgetRunSecond()
- returns for which second within a minute was job scheduled
JobSchedule
- contains info about the scheduled jobSimpleJobManager
addJob()
accepts parameterrepeatAfterSeconds
addJob()
accepts parametertimeZone
addLazyJob()
replacesCallbackJobManager
ListCommand
- prints
repeatAfterSeconds
parameter - prints job's
timeZone
parameter - adds
--timezone
(-tz
) option to show execution times in specified timezone
- prints
RunJobCommand
- stdout is caught in a buffer and printed to output in a standardized manner (to above job result by default and
into key
stdout
in case--json
option is used)
- stdout is caught in a buffer and printed to output in a standardized manner (to above job result by default and
into key
JobManager
getPair()
->getJobSchedule()
- returns
JobSchedule
instead of an array
- returns
getPairs()
->getJobSchedules()
- returns array of
JobSchedule
instead of an array of arrays
- returns array of
Scheduler
getJobs()
->getJobSchedules()
- returns array of
JobSchedule
instead of an array of arrays
- returns array of
RunSummary
getJobs()
->getJobSummaries()
JobInfo
getStart()->getTimeZone()
- returns timezone specified by the job
JobResult
getEnd()->getTimeZone()
- returns timezone specified by the job
JobResultState
skip()
renamed tolock()
JobExecutor
runJobs()
accepts list ofJobSchedule
grouped by seconds instead of list of idsrunJobs()
returnsGenerator<int, JobSummary, void, RunSummary>
instead ofRunSummary
ProcessJobExecutor
- uses microseconds instead of milliseconds for start and end times
- better exception message in case subprocess call failed
- handles stdout and stderr separately
- stderr output does not make the job processing fail
- if stderr output is produced, an exception is still thrown (explaining unexpected stderr instead of a job failure)
- stdout output is captured and converted to notice (with strict error handler it will still cause an exception, but will not block execution of other jobs)
ManagedScheduler
- acquired job locks are scoped just to their id - changing run frequency or job name will not make process loose the lock
CronExpression
is cloned after being added to job manager or scheduler for job immutability
JobManager
getExpressions()
- replaced bygetJobSchedules()
CallbackJobManager
- useSimpleJobManager->addLazyJob()
instead
ProcessJobExecutor
- use existing CronExpression instance instead of creating new one to support inheritance
ListCommand
- Fix numeric job ids in case option
--next
is used
- Fix numeric job ids in case option