Fossil SCM

Fix an error in the way that alerts are counted for use in the backoffice log.

drh 2020-07-01 22:15 trunk
Commit 77377e6c021534c9b830ed4066e817e7be2f045c0df48aa451dc3068b3316dfa
2 files changed +2 -2 +4 -4
+2 -2
--- src/alerts.c
+++ src/alerts.c
@@ -2760,15 +2760,15 @@
27602760
*/
27612761
int alert_backoffice(u32 mFlags){
27622762
int iJulianDay;
27632763
int nSent = 0;
27642764
if( !alert_tables_exist() ) return 0;
2765
- alert_send_alerts(mFlags);
2765
+ nSent = alert_send_alerts(mFlags);
27662766
iJulianDay = db_int(0, "SELECT julianday('now')");
27672767
if( iJulianDay>db_get_int("email-last-digest",0) ){
27682768
db_set_int("email-last-digest",iJulianDay,0);
2769
- nSent = alert_send_alerts(SENDALERT_DIGEST|mFlags);
2769
+ nSent += alert_send_alerts(SENDALERT_DIGEST|mFlags);
27702770
}
27712771
return nSent;
27722772
}
27732773
27742774
/*
27752775
--- src/alerts.c
+++ src/alerts.c
@@ -2760,15 +2760,15 @@
2760 */
2761 int alert_backoffice(u32 mFlags){
2762 int iJulianDay;
2763 int nSent = 0;
2764 if( !alert_tables_exist() ) return 0;
2765 alert_send_alerts(mFlags);
2766 iJulianDay = db_int(0, "SELECT julianday('now')");
2767 if( iJulianDay>db_get_int("email-last-digest",0) ){
2768 db_set_int("email-last-digest",iJulianDay,0);
2769 nSent = alert_send_alerts(SENDALERT_DIGEST|mFlags);
2770 }
2771 return nSent;
2772 }
2773
2774 /*
2775
--- src/alerts.c
+++ src/alerts.c
@@ -2760,15 +2760,15 @@
2760 */
2761 int alert_backoffice(u32 mFlags){
2762 int iJulianDay;
2763 int nSent = 0;
2764 if( !alert_tables_exist() ) return 0;
2765 nSent = alert_send_alerts(mFlags);
2766 iJulianDay = db_int(0, "SELECT julianday('now')");
2767 if( iJulianDay>db_get_int("email-last-digest",0) ){
2768 db_set_int("email-last-digest",iJulianDay,0);
2769 nSent += alert_send_alerts(SENDALERT_DIGEST|mFlags);
2770 }
2771 return nSent;
2772 }
2773
2774 /*
2775
--- src/backoffice.c
+++ src/backoffice.c
@@ -613,14 +613,14 @@
613613
backofficeBlob = &log;
614614
blob_appendf(&log, "%s %s", db_text(0, "SELECT datetime('now')"), zName);
615615
}
616616
617617
/* Here is where the actual work of the backoffice happens */
618
- nTotal += nThis = alert_backoffice(0);
619
- if( nThis ) backoffice_log("%d alerts", nThis);
620
- nTotal += nThis = smtp_cleanup();
621
- if( nThis ) backoffice_log("%d SMTPs", nThis);
618
+ nThis = alert_backoffice(0);
619
+ if( nThis ){ backoffice_log("%d alerts", nThis); nTotal += nThis; }
620
+ nThis = smtp_cleanup();
621
+ if( nThis ){ backoffice_log("%d SMTPs", nThis); nTotal += nThis; }
622622
623623
/* Close the log */
624624
if( backofficeFILE ){
625625
if( nTotal==0 ) backoffice_log("no-op");
626626
#if !defined(_WIN32)
627627
--- src/backoffice.c
+++ src/backoffice.c
@@ -613,14 +613,14 @@
613 backofficeBlob = &log;
614 blob_appendf(&log, "%s %s", db_text(0, "SELECT datetime('now')"), zName);
615 }
616
617 /* Here is where the actual work of the backoffice happens */
618 nTotal += nThis = alert_backoffice(0);
619 if( nThis ) backoffice_log("%d alerts", nThis);
620 nTotal += nThis = smtp_cleanup();
621 if( nThis ) backoffice_log("%d SMTPs", nThis);
622
623 /* Close the log */
624 if( backofficeFILE ){
625 if( nTotal==0 ) backoffice_log("no-op");
626 #if !defined(_WIN32)
627
--- src/backoffice.c
+++ src/backoffice.c
@@ -613,14 +613,14 @@
613 backofficeBlob = &log;
614 blob_appendf(&log, "%s %s", db_text(0, "SELECT datetime('now')"), zName);
615 }
616
617 /* Here is where the actual work of the backoffice happens */
618 nThis = alert_backoffice(0);
619 if( nThis ){ backoffice_log("%d alerts", nThis); nTotal += nThis; }
620 nThis = smtp_cleanup();
621 if( nThis ){ backoffice_log("%d SMTPs", nThis); nTotal += nThis; }
622
623 /* Close the log */
624 if( backofficeFILE ){
625 if( nTotal==0 ) backoffice_log("no-op");
626 #if !defined(_WIN32)
627

Keyboard Shortcuts

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