Mod Queue name

This commit is contained in:
philipp lang 2024-07-18 12:04:07 +02:00
parent 30fc4926c4
commit 63b90ef722
1 changed files with 3 additions and 2 deletions

View File

@ -23,6 +23,7 @@ class FillCoordsJob implements ShouldQueue
*/ */
public function __construct(public Geolocatable $model) public function __construct(public Geolocatable $model)
{ {
$this->onQueue('forever');
} }
/** /**
@ -32,7 +33,7 @@ class FillCoordsJob implements ShouldQueue
*/ */
public function handle() public function handle()
{ {
Redis::throttle('osm')->block(0)->allow(1)->every(2)->then(function () { Redis::throttle('osm')->block(0)->allow(1)->every(3)->then(function () {
$address = $this->model->getAddressForGeolocation(); $address = $this->model->getAddressForGeolocation();
if (!$address) { if (!$address) {
$this->model->destroyCoordinate(); $this->model->destroyCoordinate();
@ -46,7 +47,7 @@ class FillCoordsJob implements ShouldQueue
} }
$this->model->fillCoordinate($coordinate); $this->model->fillCoordinate($coordinate);
}, function () { }, function () {
$this->release(5); return $this->release(5);
}); });
} }
} }