fix: update to the caching task

pull/1486/head
iglocska 2016-08-23 00:20:20 +02:00
parent 3c0f3fb8bb
commit 45ba2b3f7c
2 changed files with 7 additions and 1 deletions

View File

@ -40,6 +40,12 @@ class TasksController extends AppController {
if (!in_array($taskName, $existingTasks)) {
$this->Task->create();
$this->Task->save($taskData);
} else {
$existingTask = $this->Task->find('first', array('recursive' => -1, 'conditions' => array('Task.type' => $taskName)));
if ($taskData['description'] != $existingTask['Task']['description']) {
$existingTask['Task']['description'] = $taskData['description'];
$this->Task->save($existingTask);
}
}
}
}

View File

@ -12,7 +12,7 @@ class Task extends AppModel {
'timer' => 0,
'scheduled_time' => '12:00',
'process_id' => '',
'description' => 'Generates export caches for every export type and for every organisation. This process is heavy, schedule so it might be a good idea to schedule this outside of working hours and before your daily automatic imports on connected services are scheduled.',
'description' => 'Generates export caches for every export type and for every organisation. This process is heavy and it is highly advised to leave export cache generation as an on-demand function for users. STIX export not included.',
'next_execution_time' => 1391601600,
'message' => 'Not scheduled yet.'