diff options
| author | winter | 2024-12-14 21:24:48 +0000 |
|---|---|---|
| committer | winter | 2024-12-14 21:45:59 +0000 |
| commit | 2f4c1de3509141880df019ef1a6cc65981b3f6ea (patch) | |
| tree | 0021f3a860d6c80869d4af5d366393f1d0eea288 /Digitigrade/Job/RefreshOutboundAuthToken.php | |
| parent | 0c6497ff02b8118bcefee37cc6fe0cbc02df4bb4 (diff) | |
implement outbound auth? untested
untested because i don't have another instance to test it against ....
Diffstat (limited to 'Digitigrade/Job/RefreshOutboundAuthToken.php')
| -rw-r--r-- | Digitigrade/Job/RefreshOutboundAuthToken.php | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/Digitigrade/Job/RefreshOutboundAuthToken.php b/Digitigrade/Job/RefreshOutboundAuthToken.php new file mode 100644 index 0000000..588617f --- /dev/null +++ b/Digitigrade/Job/RefreshOutboundAuthToken.php @@ -0,0 +1,29 @@ +<?php +namespace Digitigrade\Job; + +use Digitigrade\Job; +use Digitigrade\JobQueue; +use Digitigrade\Logger; +use Digitigrade\Model\Instance; + +class RefreshOutboundAuthToken extends Job { + public string $domain; + public string $token; + public \DateTimeInterface $when; + + public function __construct(string $domain, \DateTimeInterface $when) { + $this->domain = $domain; + $this->when = $when; + $this->remainingTries = 5; + } + + public function run() { + Logger::getInstance()->info("refreshing outbound token for $this->domain"); + $instance = Instance::findByDomain($this->domain); + $instance->refreshOutboundAuthToken(); + } + + public function submit() { + JobQueue::getInstance()->submitDelayedUntil($this, $this->when); + } +}
\ No newline at end of file |
