Skip to content

websolutespa/magento-cron-semaphore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Magento 2 Module: CronSemaphore

Purpose

When you put the semaphore in red status, all the cron jobs are suspended until you programmatically call the resume method or after the timeout limit.

How to use

Just inject the following manager:

\Websolute\CronSemaphore\Api\CronSempahoreManagerInterface $cronSempahoreManager

The use the suspend(int $forSeconds = 300) command to put the semaphore in red status:

$this->cronSempahoreManager->suspend();
$this->cronSempahoreManager->suspend(600); // Pass an integer that represents the timeout at 600 seconds

The use the resume() command to put the semaphore in green status:

$this->cronSempahoreManager->resume();

About

This Magento 2 Module allows you to suspend and resume the cron execution programmatically

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages