-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
N°4692 - Enable parallelization of multiple CRON jobs #304
Open
eespie
wants to merge
10
commits into
develop
Choose a base branch
from
feature/faf_cron_v1
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+236
−203
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
fef5a79
Cron parallelization
eespie 09a9c36
Cron parallelization
eespie 0ed76e8
Autoload updated after source/Application rename
eespie ad5aef4
Cron parallelization - change configuration param
eespie aae7f79
Cron parallelization
eespie ee48b11
Cron parallelization
eespie 997974b
Cron parallelization * better logs
eespie 84338a5
Update sources/Service/Cron/CronLog.php
eespie b316f9a
N°4692 - Enable parallelization of multiple CRON jobs
eespie ed2360a
N°4692 - Enable parallelization of multiple CRON jobs
eespie File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
/* | ||
* @copyright Copyright (C) 2010-2022 Combodo SARL | ||
* @license http://opensource.org/licenses/AGPL-3.0 | ||
*/ | ||
|
||
namespace Combodo\iTop\Service\Cron; | ||
|
||
use LogAPI; | ||
use Page; | ||
|
||
/** | ||
* @since 3.1.0 | ||
*/ | ||
class CronLog extends LogAPI | ||
eespie marked this conversation as resolved.
Show resolved
Hide resolved
|
||
{ | ||
public static $iProcessNumber = 0; | ||
private static $bDebug = false; | ||
private static $oP = null; | ||
|
||
const CHANNEL_DEFAULT = 'Cron'; | ||
/** | ||
* @inheritDoc | ||
* | ||
* As this object is used during setup, without any conf file available, customizing the level can be done by changing this constant ! | ||
*/ | ||
const LEVEL_DEFAULT = self::LEVEL_INFO; | ||
|
||
protected static $m_oFileLog = null; | ||
|
||
public static function Log($sLevel, $sMessage, $sChannel = null, $aContext = array()) | ||
{ | ||
$sMessage = 'cron'.str_pad(static::$iProcessNumber, 3).$sMessage; | ||
parent::Log($sLevel, $sMessage, $sChannel, $aContext); | ||
} | ||
|
||
public static function Debug($sMessage, $sChannel = null, $aContext = array()) | ||
{ | ||
if (self::$bDebug && self::$oP) { | ||
self::$oP->p('cron'.str_pad(static::$iProcessNumber, 3).$sMessage); | ||
} | ||
parent::Debug($sMessage, $sChannel, $aContext); | ||
} | ||
|
||
public static function SetDebug(Page $oP, $bDebug) | ||
{ | ||
self::$oP = $oP; | ||
self::$bDebug = $bDebug; | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cron_task_max_execution_time
is a setting that should stay I assume?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, the parameter will stay, but the behaviour will change (the « multiplicated by its periodicity (in seconds) » part is not pertinent anymore)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, but the current state of this PR just removes this setting parameter. Or did I miss something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fact 'cron_max_execution_time' is yet used, but 'cron_task_max_execution_time' is not used anymore... sorry for the confusion. The limit of execution of one task is the remaining cron execution time as it won't block other tasks anymore.
I'm sorry this project is pretty old now, and I'm not sure it will be integrated soon :(