Fossil SCM
Fix an error in the way that alerts are counted for use in the backoffice log.
Commit
77377e6c021534c9b830ed4066e817e7be2f045c0df48aa451dc3068b3316dfa
Parent
fda6337611ed353…
2 files changed
+2
-2
+4
-4
+2
-2
| --- src/alerts.c | ||
| +++ src/alerts.c | ||
| @@ -2760,15 +2760,15 @@ | ||
| 2760 | 2760 | */ |
| 2761 | 2761 | int alert_backoffice(u32 mFlags){ |
| 2762 | 2762 | int iJulianDay; |
| 2763 | 2763 | int nSent = 0; |
| 2764 | 2764 | if( !alert_tables_exist() ) return 0; |
| 2765 | - alert_send_alerts(mFlags); | |
| 2765 | + nSent = alert_send_alerts(mFlags); | |
| 2766 | 2766 | iJulianDay = db_int(0, "SELECT julianday('now')"); |
| 2767 | 2767 | if( iJulianDay>db_get_int("email-last-digest",0) ){ |
| 2768 | 2768 | db_set_int("email-last-digest",iJulianDay,0); |
| 2769 | - nSent = alert_send_alerts(SENDALERT_DIGEST|mFlags); | |
| 2769 | + nSent += alert_send_alerts(SENDALERT_DIGEST|mFlags); | |
| 2770 | 2770 | } |
| 2771 | 2771 | return nSent; |
| 2772 | 2772 | } |
| 2773 | 2773 | |
| 2774 | 2774 | /* |
| 2775 | 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 | 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 |
+4
-4
| --- src/backoffice.c | ||
| +++ src/backoffice.c | ||
| @@ -613,14 +613,14 @@ | ||
| 613 | 613 | backofficeBlob = &log; |
| 614 | 614 | blob_appendf(&log, "%s %s", db_text(0, "SELECT datetime('now')"), zName); |
| 615 | 615 | } |
| 616 | 616 | |
| 617 | 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); | |
| 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 | 622 | |
| 623 | 623 | /* Close the log */ |
| 624 | 624 | if( backofficeFILE ){ |
| 625 | 625 | if( nTotal==0 ) backoffice_log("no-op"); |
| 626 | 626 | #if !defined(_WIN32) |
| 627 | 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 | 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 |