} } while ($again); $timer->mark('stop_perf_subscriptions'); $lastRequestId = 0; while (true) { $timer->mark('start_worker_loop'); /* * START LOOKING FOR WORK TO Do */ echo "\n\nLOOKING FOR WORK ITEMS"; try { // Check the status of the site to determine if it should be handing out codes site_status_check(); // See if there is anything on our worklist $timer->mark('start_work_check'); if ($work->Exists()) { // Do what the users wants $i = $work->Fetch(1); $i = unserialize($i->messagetext); // print_r($i); // Figure out what the work items is and Do It! switch ($i['Action']) { case WL_NEW_PROD: new_product($i['Details']); break; case WL_DEL_PROD: delete_product($i['Details']); break; case WL_NEW_COMMENT: new_comment($i['Details']); break;