]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
The scheduler did not always idle exit as quickly as it could...
authorMichael R Sweet <michael.r.sweet@gmail.com>
Thu, 21 Feb 2019 16:03:50 +0000 (11:03 -0500)
committerMichael R Sweet <michael.r.sweet@gmail.com>
Thu, 21 Feb 2019 16:03:50 +0000 (11:03 -0500)
CHANGES.md
scheduler/main.c
scheduler/server.c
scheduler/subscriptions.c

index 6e43dbb4f9fd11d36aa98033b167f795bb7961c5..97e062b7f0d2c2a02c32d6a9ca62ca468c56aca0 100644 (file)
@@ -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
index 3b258a70ab0ce4b6d9e9116c1771b407aac489d9..276a36a82abf476cb7a5a0aac4c8b3dda27f1f79 100644 (file)
@@ -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();
 
index a4033791b4da1f5533d367ee78156d14cec5a310..bb646d8133e3a4713ccde168bddb582f6b2cfca8 100644 (file)
@@ -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...
   */
index 36bf29cebbaea5c3252db2e412d6ef96d243d552..0908f3c0cedc76a6f9ac88f561a9f46e47e0a38d 100644 (file)
@@ -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;