diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-03-22 15:18:49 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-03-22 15:32:33 +0000 |
commit | 8807b9d2a9ff9b4d9a200aec60221d6f0951f9c1 (patch) | |
tree | e7b1af385772689a424d04a2bdcfe4010b6ab5ff /src/libserver/task.c | |
parent | c9e0716e3e736c22a966a954ba2429eebda96a0a (diff) | |
download | rspamd-8807b9d2a9ff9b4d9a200aec60221d6f0951f9c1.tar.gz rspamd-8807b9d2a9ff9b4d9a200aec60221d6f0951f9c1.zip |
[Fix] Fix scan time set
Diffstat (limited to 'src/libserver/task.c')
-rw-r--r-- | src/libserver/task.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/libserver/task.c b/src/libserver/task.c index 71e38ed4c..e723fd955 100644 --- a/src/libserver/task.c +++ b/src/libserver/task.c @@ -84,6 +84,8 @@ rspamd_task_new (struct rspamd_worker *worker, struct rspamd_config *cfg, gettimeofday (&new_task->tv, NULL); new_task->time_real = rspamd_get_ticks (FALSE); new_task->time_virtual = rspamd_get_virtual_ticks (); + new_task->time_real_finish = NAN; + new_task->time_virtual_finish = NAN; new_task->lang_det = lang_det; if (pool == NULL) { @@ -1594,3 +1596,17 @@ rspamd_task_profile_get (struct rspamd_task *task, const gchar *key) return pval; } + + +gboolean +rspamd_task_set_finish_time (struct rspamd_task *task) +{ + if (isnan (task->time_real_finish)) { + task->time_real_finish = rspamd_get_ticks (FALSE); + task->time_virtual_finish = rspamd_get_virtual_ticks (); + + return TRUE; + } + + return FALSE; +}
\ No newline at end of file |