]> code.citadel.org Git - citadel.git/commitdiff
Keep track of last queue message processed
authorArt Cancro <ajc@citadel.org>
Wed, 8 Feb 2023 02:16:37 +0000 (21:16 -0500)
committerArt Cancro <ajc@citadel.org>
Wed, 8 Feb 2023 02:16:37 +0000 (21:16 -0500)
citadel/server/modules/smtp/serv_smtpclient.c

index e4d72277a8bcb663203769a2ada1dee6a16ed48f..a5e358a05e667ff392d92da214ccf2db21b6a48e 100644 (file)
@@ -498,6 +498,7 @@ void smtp_add_msg(long msgnum, void *userdata) {
 // Run through the queue sending out messages.
 void smtp_do_queue(void) {
        static int doing_smtpclient = 0;
+       static long last_queue_msg_processed = 0;
        int i = 0;
 
        // This is a concurrency check to make sure only one smtpclient run is done at a time.
@@ -509,7 +510,7 @@ void smtp_do_queue(void) {
        doing_smtpclient = 1;
        end_critical_section(S_SMTPQUEUE);
 
-       syslog(LOG_DEBUG, "smtpclient: start queue run");
+       syslog(LOG_DEBUG, "smtpclient: start queue run - last_queue_msg_processed=%ld", last_queue_msg_processed);
 
        if (CtdlGetRoom(&CC->room, SMTP_SPOOLOUT_ROOM) != 0) {
                syslog(LOG_WARNING, "smtpclient: cannot find room <%s>", SMTP_SPOOLOUT_ROOM);
@@ -534,11 +535,12 @@ void smtp_do_queue(void) {
                long m;
                memcpy(&m, array_get_element_at(smtp_queue, i), sizeof(long));
                smtp_process_one_msg(m);
+               last_queue_msg_processed = m;
        }
 
        array_free(smtp_queue);
        doing_smtpclient = 0;
-       syslog(LOG_DEBUG, "smtpclient: end queue run");
+       syslog(LOG_DEBUG, "smtpclient: end queue run - last_queue_msg_processed=%ld", last_queue_msg_processed);
 }