From 04ecc2a6a95a3c996b496b851cabc201f9716ebb Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Wed, 27 Sep 2023 14:53:04 +0200 Subject: feat(backgroundjob): Schedule job after Signed-off-by: Christoph Wurst --- lib/public/BackgroundJob/IJobList.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'lib/public/BackgroundJob') diff --git a/lib/public/BackgroundJob/IJobList.php b/lib/public/BackgroundJob/IJobList.php index 65e2f5b6250..eeca986423b 100644 --- a/lib/public/BackgroundJob/IJobList.php +++ b/lib/public/BackgroundJob/IJobList.php @@ -57,6 +57,19 @@ interface IJobList { */ public function add($job, $argument = null): void; + /** + * Add a job to the list but only run it after the given timestamp + * + * For cron background jobs this means the job will likely run shortly after the timestamp + * has been reached. For ajax background jobs the job might only run when users are active + * on the instance again. + * + * @param class-string $job + * @param mixed $argument The serializable argument to be passed to $job->run() when the job is executed + * @since 28.0.0 + */ + public function scheduleAfter(string $job, int $runAfter, $argument = null): void; + /** * Remove a job from the list * -- cgit v1.2.3