X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=twitter%2Ftwitter_sync.php;h=6c76af7ce9b49cdefba058fa9b5ad47c7f924248;hb=12994aaccd3fc3f26d470a2638b489a90b1f8e92;hp=434cb20421132b2315938b368aa7292aa313973e;hpb=dd7dc77a1051a271ce4ad46f17b0ac08ff8936b3;p=friendica-addons.git diff --git a/twitter/twitter_sync.php b/twitter/twitter_sync.php index 434cb204..6c76af7c 100644 --- a/twitter/twitter_sync.php +++ b/twitter/twitter_sync.php @@ -49,19 +49,21 @@ function twitter_sync_run($argv, $argc){ $mode = intval($argv[1]); $uid = intval($argv[2]); - /// @todo Replace it with "App::is_already_running" in the next release - $lockpath = get_lockpath(); - if ($lockpath != '') { - $pidfile = new pidfile($lockpath, 'twitter_sync-'.$mode.'-'.$uid); - if ($pidfile->is_already_running()) { - logger("Already running"); - if ($pidfile->running_time() > 9*60) { - $pidfile->kill(); - logger("killed stale process"); - // Calling a new instance - proc_run('php','addon/twitter/twitter_sync.php', $mode, $uid); + // This is deprecated with the worker + if (function_exists("get_lockpath")) { + $lockpath = get_lockpath(); + if ($lockpath != '') { + $pidfile = new pidfile($lockpath, 'twitter_sync-'.$mode.'-'.$uid); + if ($pidfile->is_already_running()) { + logger("Already running"); + if ($pidfile->running_time() > 9*60) { + $pidfile->kill(); + logger("killed stale process"); + // Calling a new instance + proc_run('php','addon/twitter/twitter_sync.php', $mode, $uid); + } + exit; } - exit; } }