aboutsummaryrefslogtreecommitdiff
path: root/src/job.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2009-02-24 14:45:19 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2009-02-24 14:45:19 +0200
commitb1472caae9a1b6905b6bbe42e69539b29febcf5c (patch)
tree3aaf7a2b4b95ecbdeceefcb8d649c4cb726e84fa /src/job.c
parentf7834b6f1aa00b7173a2fe338756c2bad4e3927b (diff)
downloadwydawca-b1472caae9a1b6905b6bbe42e69539b29febcf5c.tar.gz
wydawca-b1472caae9a1b6905b6bbe42e69539b29febcf5c.tar.bz2
Improve daemon mode.
* gconf/gconf-gram.y: Provide created lists with appropriate equal tests. Special handling for lists of strings. * src/cmdline.opt: Minor fix. * src/config.c: New keyword all-spools. * src/job.c: Hanlde "all spools" requests. * src/net.c: Likewise. * src/process.c (spool_check_alias): Rewrite using gl_list_search (scan_directories): Rename to scan_all_spools. (spool_create_timers): New function. * src/wydawca.c (all_spool_aliases): New global. (initstats): New function. * src/wydawca.h: Add new declarations.
Diffstat (limited to 'src/job.c')
-rw-r--r--src/job.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/job.c b/src/job.c
index 9678139..545d270 100644
--- a/src/job.c
+++ b/src/job.c
@@ -15,6 +15,7 @@
with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "wydawca.h"
+#include "mail.h"
#define STATE_FINISHED 0x01
#define STATE_QUEUED 0x02
@@ -35,6 +36,8 @@ struct job *queue;
size_t jobmax;
size_t jobcnt;
+static struct spool fake_spool = { "all spools" };
+
struct job *
job_locate (const struct spool *spool, uid_t uid)
{
@@ -59,8 +62,18 @@ job_active_count ()
void
wydawca_scanner (struct job *job)
{
- scan_spool (job->spool, 1, &job->uid);
+ initstats();
+ timer_start ("wydawca");
+ if (job->spool == &fake_spool)
+ scan_all_spools (1, &job->uid);
+ else
+ {
+ spool_create_timers ();
+ scan_spool (job->spool, 1, &job->uid);
+ }
+ timer_stop ("wydawca");
mail_finish ();
+ logstats ();
}
int
@@ -148,6 +161,9 @@ schedule_job (const struct spool *spool, uid_t uid)
{
struct job *job;
+ if (!spool)
+ spool = &fake_spool;
+
if (debug_level)
logmsg (LOG_DEBUG, _("scheduling job: %s, %lu"), spool->tag, uid);

Return to:

Send suggestions and report system problems to the System administrator.