queuedjob.php 621 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. /**
  3. * Copyright (c) 2013 Robin Appelman <icewind@owncloud.com>
  4. * This file is licensed under the Affero General Public License version 3 or
  5. * later.
  6. * See the COPYING-README file.
  7. */
  8. namespace OC\BackgroundJob;
  9. /**
  10. * Class QueuedJob
  11. *
  12. * create a background job that is to be executed once
  13. *
  14. * @package OC\BackgroundJob
  15. */
  16. abstract class QueuedJob extends Job {
  17. /**
  18. * run the job, then remove it from the joblist
  19. *
  20. * @param JobList $jobList
  21. * @param \OC\Log $logger
  22. */
  23. public function execute($jobList, $logger = null) {
  24. $jobList->remove($this);
  25. parent::execute($jobList, $logger);
  26. }
  27. }