wip
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Jobs;
|
||||
|
||||
use App\JobStatus;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use App\Setting;
|
||||
use Carbon\Carbon;
|
||||
@@ -56,6 +57,10 @@ class WhatsappUnsoldCommodityNotification extends Job
|
||||
return;
|
||||
}
|
||||
|
||||
if(JobStatus::where('job_id', $this->job->getJobId()) === false){
|
||||
return;
|
||||
}
|
||||
|
||||
if ($this->status === '0') {
|
||||
return;
|
||||
}
|
||||
@@ -68,9 +73,9 @@ class WhatsappUnsoldCommodityNotification extends Job
|
||||
return;
|
||||
}
|
||||
|
||||
if (!$isKomoditiStillAvailable) {
|
||||
return;
|
||||
}
|
||||
// if (!$isKomoditiStillAvailable) {
|
||||
// return;
|
||||
// }
|
||||
|
||||
foreach ($phone_numbers as $phone_number) {
|
||||
Http::get(env('WABOT_API'), [
|
||||
@@ -82,6 +87,13 @@ class WhatsappUnsoldCommodityNotification extends Job
|
||||
]);
|
||||
}
|
||||
|
||||
dispatch((new WhatsappUnsoldCommodityNotification($this->message))->delay(Carbon::now()->addMinutes(5)));
|
||||
$job_id = dispatch((new WhatsappUnsoldCommodityNotification($this->message))->delay(Carbon::now()->addMinutes(1)));
|
||||
Log::info($job_id);
|
||||
|
||||
JobStatus::on('mysql7')->create([
|
||||
'job_id' => $job_id,
|
||||
'type' => WhatsappUnsoldCommodityNotification::class,
|
||||
'status' => true,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user