diff --git a/sections/schedule/index.php b/sections/schedule/index.php index ddf83b9b..e8d5ec2c 100644 --- a/sections/schedule/index.php +++ b/sections/schedule/index.php @@ -3,9 +3,10 @@ ob_end_flush(); gc_enable(); -$PCount = shell_exec("/usr/bin/pgrep -cf schedule.php"); -if ($PCount >= 0) { - die(); +$PCount = chop(shell_exec("/usr/bin/pgrep -cf schedule.php")); +if ($PCount > 3) { + // 3 because the cron job starts two processes and pgrep finds itself + die("schedule.php is already running. Exiting ($PCount)\n"); } //TODO: make it awesome, make it flexible! diff --git a/static/functions/lastfm.js b/static/functions/lastfm.js index 76ed4f5e..b188be4a 100644 --- a/static/functions/lastfm.js +++ b/static/functions/lastfm.js @@ -215,7 +215,7 @@ // Fix Last.fm API returning more than one entry despite limit on certain conditions. if ( typeof(json[0]) === "object" ) json = json[0]; html += '