diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-11-07 14:31:08 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-11-07 14:31:08 +0000 |
commit | 296c0cd69431ffc59b12adff6b3d58c9069f81ff (patch) | |
tree | 61df11a3683644cee24310467e22e2d3b9c55435 /src/rspamd.h | |
parent | 5172bac9ff82d0abc316d40b61cec13b91903a1a (diff) | |
download | rspamd-296c0cd69431ffc59b12adff6b3d58c9069f81ff.tar.gz rspamd-296c0cd69431ffc59b12adff6b3d58c9069f81ff.zip |
[Rework] Rework final scripts logic
Diffstat (limited to 'src/rspamd.h')
-rw-r--r-- | src/rspamd.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/rspamd.h b/src/rspamd.h index d32681359..773be7c56 100644 --- a/src/rspamd.h +++ b/src/rspamd.h @@ -82,6 +82,14 @@ struct rspamd_worker_heartbeat { gint64 nbeats; /**< positive for beats received, negative for beats missed */ }; +enum rspamd_worker_state { + rspamd_worker_state_running = 0, + rspamd_worker_state_terminating, + rspamd_worker_wait_connections, + rspamd_worker_wait_final_scripts, + rspamd_worker_wanna_die +}; + /** * Worker process structure */ @@ -90,7 +98,7 @@ struct rspamd_worker { pid_t ppid; /**< pid of parent */ guint index; /**< index number */ guint nconns; /**< current connections count */ - gboolean wanna_die; /**< worker is terminating */ + enum rspamd_worker_state state; /**< current worker state */ gboolean cores_throttled; /**< set to true if cores throttling took place */ gdouble start_time; /**< start time */ struct rspamd_main *srv; /**< pointer to server structure */ @@ -108,7 +116,6 @@ struct rspamd_worker { struct rspamd_worker_heartbeat hb; /**< heartbeat data */ gpointer control_data; /**< used by control protocol to handle commands */ gpointer tmp_data; /**< used to avoid race condition to deal with control messages */ - GPtrArray *finish_actions; /**< called when worker is terminated */ ev_child cld_ev; /**< to allow reaping */ rspamd_worker_term_cb term_handler; /**< custom term handler */ }; |