aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public/BackgroundJob
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2023-09-27 14:53:04 +0200
committerChristoph Wurst <christoph@winzerhof-wurst.at>2023-09-29 10:29:40 +0200
commit04ecc2a6a95a3c996b496b851cabc201f9716ebb (patch)
tree633b540b89ec7c68d0e4d8fd6f8ec727c9811b81 /lib/public/BackgroundJob
parentf8f437072ac13a4556dea18219d55f11466497e5 (diff)
downloadnextcloud-server-04ecc2a6a95a3c996b496b851cabc201f9716ebb.tar.gz
nextcloud-server-04ecc2a6a95a3c996b496b851cabc201f9716ebb.zip
feat(backgroundjob): Schedule job after <timestamp>
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib/public/BackgroundJob')
-rw-r--r--lib/public/BackgroundJob/IJobList.php13
1 files changed, 13 insertions, 0 deletions
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
@@ -58,6 +58,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<IJob> $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
*
* @param IJob|class-string<IJob> $job