simplify journaling of expiring unborn messages

don't use a separate journal command anymore, but handle them like
regular expirations, and let the entry purge loop at the end cleanup
them.
This commit is contained in:
Oswald Buddenhagen 2022-02-26 18:24:04 +01:00
parent eab3874918
commit 1ca278ad0d
2 changed files with 2 additions and 9 deletions

View File

@ -1319,14 +1319,14 @@ box_loaded( int sts, message_t *msgs, int total_msgs, int recent_msgs, void *aux
}
} else {
if (srec->status & S_NEXPIRE) {
JLOG( "= %u %u", (srec->uid[F], srec->uid[N]), "expire unborn" );
srec->status = S_EXPIRE | S_EXPIRED;
JLOG( "~ %u %u %u", (srec->uid[F], srec->uid[N], srec->status), "expire unborn" );
// If we have so many new messages that some of them are instantly expired,
// but some are still propagated because they are important, we need to
// ensure explicitly that the bulk fetch limit is upped.
if (svars->maxxfuid < srec->uid[F])
svars->maxxfuid = srec->uid[F];
srec->msg[F]->srec = NULL;
srec->status = S_DEAD;
}
}
}

View File

@ -298,7 +298,6 @@ load_state( sync_vars_t *svars )
case '+':
case '&':
case '-':
case '=':
case '_':
case '|':
bad = sscanf( buf + 2, "%u %u", &t1, &t2 ) != 2;
@ -364,12 +363,6 @@ load_state( sync_vars_t *svars )
debug( "killed\n" );
srec->status = S_DEAD;
break;
case '=':
debug( "aborted\n" );
if (svars->maxxfuid < srec->uid[F])
svars->maxxfuid = srec->uid[F];
srec->status = S_DEAD;
break;
case '#':
memcpy( srec->tuid, buf + tn + 2, TUIDL );
debug( "TUID now %." stringify(TUIDL) "s\n", srec->tuid );