diff options
Diffstat (limited to 'src/job.c')
-rw-r--r-- | src/job.c | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -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); |