rename appconfig keys for backgroundjobs

This commit is contained in:
Jakob Sack 2012-08-09 10:40:39 +02:00
parent 37ee88aa6d
commit 889f0a1c6d
3 changed files with 11 additions and 11 deletions

View File

@ -23,19 +23,19 @@
$RUNTIME_NOSETUPFS = true;
require_once('lib/base.php');
$appmode = OC_Appconfig::getValue( 'core', 'backgroundjob_mode', 'ajax' );
$appmode = OC_Appconfig::getValue( 'core', 'backgroundjobs_mode', 'ajax' );
if( OC::$CLI ){
if( $appmode != 'cron' ){
OC_Appconfig::setValue( 'core', 'backgroundjob_mode', 'cron' );
OC_Appconfig::setValue( 'core', 'backgroundjobs_mode', 'cron' );
}
// check if backgroundjobs is still running
$pid = OC_Appconfig::getValue( 'core', 'backgroundjob_pid', false );
$pid = OC_Appconfig::getValue( 'core', 'backgroundjobs_pid', false );
if( $pid !== false ){
// FIXME: check if $pid is still alive (*nix/mswin). if so then exit
}
// save pid
OC_Appconfig::setValue( 'core', 'backgroundjob_pid', getmypid());
OC_Appconfig::setValue( 'core', 'backgroundjobs_pid', getmypid());
// Work
OC_BackgroundJob_Worker::doAllSteps();

View File

@ -60,11 +60,11 @@ class OC_BackgroundJob_Worker{
* services.
*/
public static function doNextStep(){
$laststep = OC_Appconfig::getValue( 'core', 'backgroundjob_step', 'regular_tasks' );
$laststep = OC_Appconfig::getValue( 'core', 'backgroundjobs_step', 'regular_tasks' );
if( $laststep == 'regular_tasks' ){
// get last app
$lasttask = OC_Appconfig::getValue( 'core', 'backgroundjob_task', '' );
$lasttask = OC_Appconfig::getValue( 'core', 'backgroundjobs_task', '' );
// What's the next step?
$regular_tasks = OC_BackgroundJob_RegularTask::all();
@ -74,7 +74,7 @@ class OC_BackgroundJob_Worker{
// search for next background job
foreach( $regular_tasks as $key => $value ){
if( strcmp( $lasttask, $key ) > 0 ){
OC_Appconfig::getValue( 'core', 'backgroundjob_task', $key );
OC_Appconfig::getValue( 'core', 'backgroundjobs_task', $key );
$done = true;
call_user_func( $value );
break;
@ -83,7 +83,7 @@ class OC_BackgroundJob_Worker{
if( $done == false ){
// Next time load scheduled tasks
OC_Appconfig::setValue( 'core', 'backgroundjob_step', 'scheduled_tasks' );
OC_Appconfig::setValue( 'core', 'backgroundjobs_step', 'scheduled_tasks' );
}
}
else{
@ -99,8 +99,8 @@ class OC_BackgroundJob_Worker{
}
else{
// Next time load scheduled tasks
OC_Appconfig::setValue( 'core', 'backgroundjob_step', 'regular_tasks' );
OC_Appconfig::setValue( 'core', 'backgroundjob_task', '' );
OC_Appconfig::setValue( 'core', 'backgroundjobs_step', 'regular_tasks' );
OC_Appconfig::setValue( 'core', 'backgroundjobs_task', '' );
}
}

View File

@ -234,7 +234,7 @@ class OC{
//OC_Util::addScript( "multiselect" );
OC_Util::addScript('search','result');
if( OC_Appconfig::getValue( 'core', 'backgroundjob_mode', 'ajax' ) == 'ajax' ){
if( OC_Appconfig::getValue( 'core', 'backgroundjobs_mode', 'ajax' ) == 'ajax' ){
OC_Util::addScript( 'backgroundjobs' );
}