Prevent Worker from running when 3rd parties are disabled
[MAILPOET-5826]
This commit is contained in:
@@ -24,9 +24,16 @@ class Beamer extends SimpleWorker {
|
||||
}
|
||||
|
||||
public function processTaskStrategy(ScheduledTaskEntity $task, $timer) {
|
||||
if (!$this->isBeamerEnabled()) {
|
||||
return false;
|
||||
}
|
||||
return $this->setLastAnnouncementDate();
|
||||
}
|
||||
|
||||
private function isBeamerEnabled(): bool {
|
||||
return $this->settings->get('3rd_party_libs.enabled') === '1';
|
||||
}
|
||||
|
||||
public function setLastAnnouncementDate() {
|
||||
$response = $this->wp->wpRemoteGet(self::API_URL . '/posts?published=true&maxResults=1', [
|
||||
'headers' => [
|
||||
|
Reference in New Issue
Block a user