From: Michael R Sweet Date: Thu, 21 Feb 2019 16:03:50 +0000 (-0500) Subject: The scheduler did not always idle exit as quickly as it could... X-Git-Tag: v2.3b8~102 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=47b3bd03e4bbacf355ccdadce4b0331e6944f140;p=thirdparty%2Fcups.git The scheduler did not always idle exit as quickly as it could... --- diff --git a/CHANGES.md b/CHANGES.md index 6e43dbb4f9..97e062b7f0 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -32,6 +32,7 @@ Changes in CUPS v2.3b8 - Localization updates (Issue #5461, Issues #5471, Issue #5481, Issue #5486, Issue #5489, Issue #5491, Issue #5492, Issue #5493, Issue #5494, Issue #5495, Issue #5497, Issue #5499, Issue #5500, Issue #5501, Issue #5504) +- The scheduler did not always idle exit as quickly as it could. Changes in CUPS v2.3b7 diff --git a/scheduler/main.c b/scheduler/main.c index 3b258a70ab..276a36a82a 100644 --- a/scheduler/main.c +++ b/scheduler/main.c @@ -1,7 +1,7 @@ /* * Main loop for the CUPS scheduler. * - * Copyright © 2007-2018 by Apple Inc. + * Copyright © 2007-2019 by Apple Inc. * Copyright © 1997-2007 by Easy Software Products, all rights reserved. * * Licensed under Apache License v2.0. See the file "LICENSE" for more @@ -813,7 +813,7 @@ main(int argc, /* I - Number of command-line args */ * inactivity... */ - if (timeout == 86400 && OnDemand && IdleExitTimeout && + if (OnDemand && IdleExitTimeout && # ifdef HAVE_SYSTEMD !WebInterface && # endif /* HAVE_SYSTEMD */ @@ -963,8 +963,7 @@ main(int argc, /* I - Number of command-line args */ if (current_time > expire_time) { - if (cupsArrayCount(Subscriptions) > 0) - cupsdExpireSubscriptions(NULL, NULL); + cupsdExpireSubscriptions(NULL, NULL); cupsdUnloadCompletedJobs(); diff --git a/scheduler/server.c b/scheduler/server.c index a4033791b4..bb646d8133 100644 --- a/scheduler/server.c +++ b/scheduler/server.c @@ -1,7 +1,7 @@ /* * Server start/stop routines for the CUPS scheduler. * - * Copyright 2007-2017 by Apple Inc. + * Copyright 2007-2019 by Apple Inc. * Copyright 1997-2006 by Easy Software Products, all rights reserved. * * Licensed under Apache License v2.0. See the file "LICENSE" for more information. @@ -172,6 +172,15 @@ cupsdStopServer(void) cupsdDestroyProfile(DefaultProfile); DefaultProfile = NULL; + /* + * Expire subscriptions and clean out old jobs... + */ + + cupsdExpireSubscriptions(NULL, NULL); + + if (JobHistoryUpdate) + cupsdCleanJobs(); + /* * Write out any dirty files... */ diff --git a/scheduler/subscriptions.c b/scheduler/subscriptions.c index 36bf29cebb..0908f3c0ce 100644 --- a/scheduler/subscriptions.c +++ b/scheduler/subscriptions.c @@ -1,7 +1,7 @@ /* * Subscription routines for the CUPS scheduler. * - * Copyright 2007-2014 by Apple Inc. + * Copyright 2007-2019 by Apple Inc. * Copyright 1997-2007 by Easy Software Products, all rights reserved. * * Licensed under Apache License v2.0. See the file "LICENSE" for more information. @@ -648,6 +648,9 @@ cupsdExpireSubscriptions( time_t curtime; /* Current time */ + if (cupsArrayCount(Subscriptions) == 0) + return; + curtime = time(NULL); update = 0;