Add forced discard after 10 delivery failures, don't crash when a search doesn't return an account

master
teknomunk 1 year ago
parent e4513a4fc8
commit 68bdc0718f

@ -85,7 +85,9 @@ static bool handle_search( struct http_request* req )
}
fprintf( f, "[" );
api_Account_write(a,f,1);
if( a ) {
api_Account_write(a,f,1);
}
fprintf( f, "]" );
account_free(a);

@ -122,6 +122,11 @@ static bool process_envelope( int id )
if( env->retry_after ) {
env->retries += 1;
}
if( env->retries > 10 ) {
// Force discard after 10 delivery attempts
// TODO: change this to a configuration option
env->sent = true;
}
env->retry_after = time(NULL) + 60 * ( env->retries + 1 ) * ( env->retries + 1 );
outbox_envelope_save(env);
}

@ -1 +1 @@
Subproject commit 1a630944a79aa31d95be7ee1b37a37f8556cd1c5
Subproject commit 5ed4d47ba63963edf8373dbb1e095060888abd6e
Loading…
Cancel
Save