Skip to content

Commit

Permalink
fix: queue up job directly
Browse files Browse the repository at this point in the history
  • Loading branch information
wilr committed Oct 16, 2022
1 parent 9f996ed commit 7b53834
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/RefreshXeroTokenJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace FullscreenInteractive\SilverStripeXero;

use SilverStripe\Core\Injector\Injector;
use Symbiote\QueuedJobs\Services\AbstractQueuedJob;

class RefreshXeroTokenJob extends AbstractQueuedJob
Expand All @@ -19,6 +20,12 @@ public function process()

$this->addMessage('Token refreshed until: '. date('d/m/Y H:i:s', $date));

$job = new RefreshXeroTokenJob();
Injector::inst()->get('Symbiote\QueuedJobs\Services\QueuedJobService')->queueJob(
$job,
date('Y-m-d H:i:s', "+10 minutes")
);

$this->isComplete = true;
}
}

0 comments on commit 7b53834

Please sign in to comment.