plan add last_runtime
This commit is contained in:
@@ -11,6 +11,7 @@ class Plan extends CI_Controller
|
||||
{
|
||||
|
||||
private $plan;
|
||||
private $key_last_runtime = 'lc_plan_last_runtime';
|
||||
|
||||
protected $log_dir;
|
||||
|
||||
@@ -64,6 +65,14 @@ class Plan extends CI_Controller
|
||||
$this->plan = $plan;
|
||||
}
|
||||
|
||||
public function last_runtime(){
|
||||
$redis = &load_cache('redis');
|
||||
$value = $redis->get($this->key_last_runtime);
|
||||
!$value && $value = 0;
|
||||
$dts = $value ? date("Y-m-d H:i:s", $value) : '';
|
||||
echo json_encode(array('last_runtime'=>$value, 'datetime' => $dts), JSON_UNESCAPED_UNICODE);
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$plan = $this->plan;
|
||||
@@ -88,6 +97,9 @@ class Plan extends CI_Controller
|
||||
|
||||
echo "Finished " . date("Y-m-d H:i:s") . "\n";
|
||||
}
|
||||
|
||||
$redis = &load_cache('redis');
|
||||
$redis->save($this->key_last_runtime, time());
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user