File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
eclair-core/src/main/scala/fr/acinq/eclair/db Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -43,13 +43,16 @@ object RevokedHtlcInfoCleaner {
4343 Behaviors .setup { context =>
4444 context.system.eventStream ! EventStream .Subscribe (context.self)
4545 Behaviors .withTimers { timers =>
46- timers.startTimerWithFixedDelay (DeleteBatch , config.interval)
46+ timers.startSingleTimer (DeleteBatch , config.interval)
4747 Behaviors .receiveMessage {
4848 case ForgetHtlcInfos (channelId, beforeCommitIndex) =>
4949 db.markHtlcInfosForRemoval(channelId, beforeCommitIndex)
5050 Behaviors .same
5151 case DeleteBatch =>
5252 db.removeHtlcInfos(config.batchSize)
53+ // We restart a new timer after each batch, instead of using a timer at fixed intervals.
54+ // This ensures that we don't have DeleteBatch messages queuing up in the mailbox when the DB is busy.
55+ timers.startSingleTimer(DeleteBatch , config.interval)
5356 Behaviors .same
5457 }
5558 }
You can’t perform that action at this time.
0 commit comments