diff --git a/test/SchedulerTest.php b/test/SchedulerTest.php index 638c0c2..39be0fb 100644 --- a/test/SchedulerTest.php +++ b/test/SchedulerTest.php @@ -22,9 +22,9 @@ public function testScheduler() } $scheduler = new JobScheduler(0, $redisConf['host'], $redisConf['port'], $db, 15, 15, __DIR__."/../vendor/autoload.php"); self::addJob($redisConf, $result); - $scheduler->run(function ($keyArray, $value, $way) use ($result) { + $scheduler->run(function ($attrs, $value, $way) use ($result) { $wayStr = $way == 0 ? 'polling' : 'notification'; - $id = str_replace(JobManager::SCHEDULE_KEY_PREFIX, '', $key); + $id = join(':', $attrs); $diff = time() - $result[$id]; if (self::DEBUG) { echo "current: ".time()." expected: $result[$id] Diff time: $diff\n"; diff --git a/test/job_test.php b/test/job_test.php index a3a9cf5..1f6b8d7 100644 --- a/test/job_test.php +++ b/test/job_test.php @@ -23,9 +23,9 @@ function init($redisConf, $isJobSubmitter = false) $scheduler->getLooper()->addPeriodicTimer(20, function () use ($redisConf) { testAddJob($redisConf); }); - $scheduler->run(function ($keyArray, $value, $way) { + $scheduler->run(function ($attrs, $value, $way) { $wayStr = $way == 0 ? 'polling' : 'notification'; - echo "Job is ready: key: ".json_encode($keyArray)." value: $value [$wayStr]\n"; + echo "Job is ready: key: ".json_encode($attrs)." value: $value [$wayStr]\n"; }); } catch (\RedisException $exception) { echo "Exception:$exception\n";