diff options
Diffstat (limited to 'lib/private/backgroundjob')
-rw-r--r-- | lib/private/backgroundjob/joblist.php | 3 | ||||
-rw-r--r-- | lib/private/backgroundjob/queuedjob.php | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/lib/private/backgroundjob/joblist.php b/lib/private/backgroundjob/joblist.php index 9d15cd1663a..f8b88f9a89b 100644 --- a/lib/private/backgroundjob/joblist.php +++ b/lib/private/backgroundjob/joblist.php @@ -42,6 +42,9 @@ class JobList implements IJobList { $class = $job; } $argument = json_encode($argument); + if (strlen($argument) > 4000) { + throw new \InvalidArgumentException('Background job arguments can\'t exceed 4000 characters (json encoded)'); + } $query = $this->conn->prepare('INSERT INTO `*PREFIX*jobs`(`class`, `argument`, `last_run`) VALUES(?, ?, 0)'); $query->execute(array($class, $argument)); } diff --git a/lib/private/backgroundjob/queuedjob.php b/lib/private/backgroundjob/queuedjob.php index 799eac47848..b73072b535f 100644 --- a/lib/private/backgroundjob/queuedjob.php +++ b/lib/private/backgroundjob/queuedjob.php @@ -23,7 +23,7 @@ abstract class QueuedJob extends Job { * @param \OC\Log $logger */ public function execute($jobList, $logger = null) { - $jobList->remove($this); + $jobList->remove($this, $this->argument); parent::execute($jobList, $logger); } } |