Fossil SCM
Avoid logging errors associated with the inability to access the database specified for outgoing email.
Commit
2787a454d0d97b0073a7f2655c2004c0973c5882ef02b636a1505e172b09335e
Parent
42076cabfa45198…
1 file changed
+5
+5
| --- src/stat.c | ||
| +++ src/stat.c | ||
| @@ -74,19 +74,24 @@ | ||
| 74 | 74 | ){ |
| 75 | 75 | sqlite3 *db; |
| 76 | 76 | sqlite3_stmt *pStmt; |
| 77 | 77 | int rc; |
| 78 | 78 | @ Queued to database "%h(zDb)" |
| 79 | + g.dbIgnoreErrors++; | |
| 79 | 80 | rc = sqlite3_open(zDb, &db); |
| 80 | 81 | if( rc==SQLITE_OK ){ |
| 81 | 82 | rc = sqlite3_prepare_v2(db, "SELECT count(*) FROM email",-1,&pStmt,0); |
| 82 | 83 | if( rc==SQLITE_OK && sqlite3_step(pStmt)==SQLITE_ROW ){ |
| 83 | 84 | @ (%,d(sqlite3_column_int(pStmt,0)) messages, |
| 84 | 85 | @ %,d(file_size(zDb,ExtFILE)) bytes) |
| 85 | 86 | } |
| 86 | 87 | sqlite3_finalize(pStmt); |
| 87 | 88 | } |
| 89 | + g.dbIgnoreErrors--; | |
| 90 | + if( rc ){ | |
| 91 | + @ ← cannot access database! | |
| 92 | + } | |
| 88 | 93 | sqlite3_close(db); |
| 89 | 94 | }else |
| 90 | 95 | if( fossil_strcmp(zDest,"dir")==0 |
| 91 | 96 | && (zDir = db_get("email-send-dir",0))!=0 |
| 92 | 97 | ){ |
| 93 | 98 |
| --- src/stat.c | |
| +++ src/stat.c | |
| @@ -74,19 +74,24 @@ | |
| 74 | ){ |
| 75 | sqlite3 *db; |
| 76 | sqlite3_stmt *pStmt; |
| 77 | int rc; |
| 78 | @ Queued to database "%h(zDb)" |
| 79 | rc = sqlite3_open(zDb, &db); |
| 80 | if( rc==SQLITE_OK ){ |
| 81 | rc = sqlite3_prepare_v2(db, "SELECT count(*) FROM email",-1,&pStmt,0); |
| 82 | if( rc==SQLITE_OK && sqlite3_step(pStmt)==SQLITE_ROW ){ |
| 83 | @ (%,d(sqlite3_column_int(pStmt,0)) messages, |
| 84 | @ %,d(file_size(zDb,ExtFILE)) bytes) |
| 85 | } |
| 86 | sqlite3_finalize(pStmt); |
| 87 | } |
| 88 | sqlite3_close(db); |
| 89 | }else |
| 90 | if( fossil_strcmp(zDest,"dir")==0 |
| 91 | && (zDir = db_get("email-send-dir",0))!=0 |
| 92 | ){ |
| 93 |
| --- src/stat.c | |
| +++ src/stat.c | |
| @@ -74,19 +74,24 @@ | |
| 74 | ){ |
| 75 | sqlite3 *db; |
| 76 | sqlite3_stmt *pStmt; |
| 77 | int rc; |
| 78 | @ Queued to database "%h(zDb)" |
| 79 | g.dbIgnoreErrors++; |
| 80 | rc = sqlite3_open(zDb, &db); |
| 81 | if( rc==SQLITE_OK ){ |
| 82 | rc = sqlite3_prepare_v2(db, "SELECT count(*) FROM email",-1,&pStmt,0); |
| 83 | if( rc==SQLITE_OK && sqlite3_step(pStmt)==SQLITE_ROW ){ |
| 84 | @ (%,d(sqlite3_column_int(pStmt,0)) messages, |
| 85 | @ %,d(file_size(zDb,ExtFILE)) bytes) |
| 86 | } |
| 87 | sqlite3_finalize(pStmt); |
| 88 | } |
| 89 | g.dbIgnoreErrors--; |
| 90 | if( rc ){ |
| 91 | @ ← cannot access database! |
| 92 | } |
| 93 | sqlite3_close(db); |
| 94 | }else |
| 95 | if( fossil_strcmp(zDest,"dir")==0 |
| 96 | && (zDir = db_get("email-send-dir",0))!=0 |
| 97 | ){ |
| 98 |