diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2020-04-18 22:18:39 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2020-04-18 22:18:39 +0300 |
commit | 5e93c56acf080ef006176076be4efab4aa0591c0 (patch) | |
tree | ce5a296fcbb5c47823e2ba3343b3673e7cc5d6b4 /src/directive.c | |
parent | 7c8140491ce8547fe45a791fb0a185817b5ff8ec (diff) | |
download | wydawca-5e93c56acf080ef006176076be4efab4aa0591c0.tar.gz wydawca-5e93c56acf080ef006176076be4efab4aa0591c0.tar.bz2 |
Fix statistics gathering. Display stats at the end of the run in cron mode.
* src/directive.c (process_directives): Raise the 'destroying' flag
prior to removing the directive file, in order to avoid the removal
being caught by the watcher thread.
* src/timer.c (wydawca_stats_export, wydawca_stats_update): New
functions.
* src/triplet.c (triplet_list_lock,triplet_list_unlock): Check for
NULL pointer.
(remove_triplet_unlocked): Set the 'destroying' flag.
(triplet_remove_file): Do nothing if the 'destroying' flag is set.
(wy_thr_triplet): Call logstats only in the daemon mode. Otherwise
call wydawca_stats_update.
* src/wydawca.c (wy_main): Call wydawca_stats_export at the beginning.
Call logstats before exiting, unless in daemon mode.
* src/wydawca.h (struct wy_triplet): New member: destroying.
(wydawca_stats_export,wydawca_stats_update): New protos.
* tests/check-fail.at: Update.
* tests/check-notify.at: Update.
* tests/upl12f.at: Update.
Diffstat (limited to 'src/directive.c')
-rw-r--r-- | src/directive.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/directive.c b/src/directive.c index 48c93ae..b1b5a79 100644 --- a/src/directive.c +++ b/src/directive.c @@ -661,6 +661,7 @@ process_directives(struct wy_triplet *trp) } } + trp->destroying = 1; if (!wy_dry_run && unlinkat(trp->spool->source_fd, trp->file[file_directive].name, 0)) { wy_log(LOG_CRIT, _("%s: cannot unlink directive file: %s"), |