Fossil SCM

Fix the backoffice delay so that it extends the deadline for the follow-on process if the current process runs overtime. This prevents multiple follow-ons.

drh 2018-07-19 02:37 trunk
Commit 5542cd43b3fe305c41009ff4f6c1e6ddf3562cf00ecfb8a8959ae12ac21753d3
1 file changed +13 -1
+13 -1
--- src/backoffice.c
+++ src/backoffice.c
@@ -224,11 +224,11 @@
224224
break;
225225
}
226226
/* This process needs to queue up and wait for the current lease
227227
** to expire before continuing. */
228228
x.idNext = idSelf;
229
- x.tmNext = x.tmCurrent + BKOFCE_LEASE_TIME;
229
+ x.tmNext = (tmNow>x.tmCurrent ? tmNow : x.tmCurrent) + BKOFCE_LEASE_TIME;
230230
backofficeWriteLease(&x);
231231
db_end_transaction(0);
232232
if( x.tmCurrent >= tmNow ){
233233
sqlite3_sleep(1000*(x.tmCurrent - tmNow + 1));
234234
}else{
@@ -249,5 +249,17 @@
249249
** backoffice processing tasks, add them here.
250250
*/
251251
void backoffice_work(void){
252252
email_auto_exec(0);
253253
}
254
+
255
+/*
256
+** COMMAND: test-backoffice
257
+**
258
+** Usage: test-backoffice
259
+**
260
+** Run backoffice processing
261
+*/
262
+void test_backoffice_command(void){
263
+ db_find_and_open_repository(0,0);
264
+ backoffice_run();
265
+}
254266
--- src/backoffice.c
+++ src/backoffice.c
@@ -224,11 +224,11 @@
224 break;
225 }
226 /* This process needs to queue up and wait for the current lease
227 ** to expire before continuing. */
228 x.idNext = idSelf;
229 x.tmNext = x.tmCurrent + BKOFCE_LEASE_TIME;
230 backofficeWriteLease(&x);
231 db_end_transaction(0);
232 if( x.tmCurrent >= tmNow ){
233 sqlite3_sleep(1000*(x.tmCurrent - tmNow + 1));
234 }else{
@@ -249,5 +249,17 @@
249 ** backoffice processing tasks, add them here.
250 */
251 void backoffice_work(void){
252 email_auto_exec(0);
253 }
 
 
 
 
 
 
 
 
 
 
 
 
254
--- src/backoffice.c
+++ src/backoffice.c
@@ -224,11 +224,11 @@
224 break;
225 }
226 /* This process needs to queue up and wait for the current lease
227 ** to expire before continuing. */
228 x.idNext = idSelf;
229 x.tmNext = (tmNow>x.tmCurrent ? tmNow : x.tmCurrent) + BKOFCE_LEASE_TIME;
230 backofficeWriteLease(&x);
231 db_end_transaction(0);
232 if( x.tmCurrent >= tmNow ){
233 sqlite3_sleep(1000*(x.tmCurrent - tmNow + 1));
234 }else{
@@ -249,5 +249,17 @@
249 ** backoffice processing tasks, add them here.
250 */
251 void backoffice_work(void){
252 email_auto_exec(0);
253 }
254
255 /*
256 ** COMMAND: test-backoffice
257 **
258 ** Usage: test-backoffice
259 **
260 ** Run backoffice processing
261 */
262 void test_backoffice_command(void){
263 db_find_and_open_repository(0,0);
264 backoffice_run();
265 }
266

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button