diff options
author | Christian Grothoff <christian@grothoff.org> | 2008-06-29 06:16:46 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2008-06-29 06:16:46 +0000 |
commit | ac661c46da50aa616c32c369bd6aab3002059897 (patch) | |
tree | 91287b18229dc6bcc1d8aec32ebb82565a0fc501 | |
parent | d2d66bddb7675dc920ddfc0cc7f0ff16e05c83c3 (diff) | |
download | gnunet-gtk-ac661c46da50aa616c32c369bd6aab3002059897.tar.gz gnunet-gtk-ac661c46da50aa616c32c369bd6aab3002059897.zip |
make sure frequency goes back down to 15s even if gnunetd does not get started; also, del cron job like that is not nice, possibly not legal with cron under certain circumstances, so avoiding it is a good idea
-rw-r--r-- | src/plugins/daemon/daemon.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/plugins/daemon/daemon.c b/src/plugins/daemon/daemon.c index 1e0280a6..703e5c4b 100644 --- a/src/plugins/daemon/daemon.c +++ b/src/plugins/daemon/daemon.c | |||
@@ -253,11 +253,6 @@ cronCheckDaemon (void *dummy) | |||
253 | { | 253 | { |
254 | updateAppModel (NULL); | 254 | updateAppModel (NULL); |
255 | last = ret; | 255 | last = ret; |
256 | GNUNET_cron_del_job (cron, &cronCheckDaemon, | ||
257 | 1/2 * GNUNET_CRON_SECONDS, NULL); | ||
258 | GNUNET_cron_add_job (cron, &cronCheckDaemon, | ||
259 | 15 * GNUNET_CRON_SECONDS, | ||
260 | 15 * GNUNET_CRON_SECONDS, NULL); | ||
261 | } | 256 | } |
262 | GNUNET_GTK_save_call (&doUpdateMenus, &ret); | 257 | GNUNET_GTK_save_call (&doUpdateMenus, &ret); |
263 | } | 258 | } |
@@ -367,6 +362,7 @@ on_stopDaemon_clicked_daemon (GtkWidget * widget, gpointer data) | |||
367 | GtkWidget *killEntry = NULL; | 362 | GtkWidget *killEntry = NULL; |
368 | GtkWidget *statsEntry; | 363 | GtkWidget *statsEntry; |
369 | struct GNUNET_ClientServerConnection *sock; | 364 | struct GNUNET_ClientServerConnection *sock; |
365 | int i; | ||
370 | 366 | ||
371 | GNUNET_cron_del_job (cron, &cronCheckDaemon, 15 * GNUNET_CRON_SECONDS, | 367 | GNUNET_cron_del_job (cron, &cronCheckDaemon, 15 * GNUNET_CRON_SECONDS, |
372 | NULL); | 368 | NULL); |
@@ -401,8 +397,11 @@ on_stopDaemon_clicked_daemon (GtkWidget * widget, gpointer data) | |||
401 | } | 397 | } |
402 | GNUNET_client_connection_destroy (sock); | 398 | GNUNET_client_connection_destroy (sock); |
403 | } | 399 | } |
404 | GNUNET_cron_add_job (cron, &cronCheckDaemon, 1 * GNUNET_CRON_SECONDS, | 400 | for (i=0;i<10;i++) |
405 | 1/2 * GNUNET_CRON_SECONDS, NULL); | 401 | GNUNET_cron_add_job (cron, |
402 | &cronCheckDaemon, | ||
403 | (i+1) * 500 * GNUNET_CRON_MILLISECONDS, | ||
404 | 0, NULL); | ||
406 | } | 405 | } |
407 | 406 | ||
408 | void | 407 | void |