From 128fc6a3b52e43208e965da03966e519d6149355 Mon Sep 17 00:00:00 2001 From: jacob Date: Thu, 2 Dec 2010 17:25:23 +0000 Subject: [PATCH] Added logging to the API, and separated the log file creation into a common function --- admin/judges_sa_launcher.php | 11 +++-------- api.php | 6 ++++++ common.inc.functions.php | 14 ++++++++++++++ 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/admin/judges_sa_launcher.php b/admin/judges_sa_launcher.php index caad1e5e..2d20d53c 100644 --- a/admin/judges_sa_launcher.php +++ b/admin/judges_sa_launcher.php @@ -1,15 +1,10 @@ ../data/logs/judge_scheduler_".date("YmdHis").".log 2>&1 &"); +exec("nice php judges_sa.php {$_SERVER['PHP_SELF']} > $logPath/judge_scheduler_".date("YmdHis").".log 2>&1 &"); usleep(1500000); // 1.5 second to allow the judges_sa to update the % status to 0% otherwise the status page will think its not running if it gets there too soon header("Location: judges_scheduler_status.php"); exit; diff --git a/api.php b/api.php index eff05252..3991fb0d 100644 --- a/api.php +++ b/api.php @@ -23,6 +23,7 @@ ?>