build: Add delayed_replay_queue option

When folder session is claimed, that can lock for some ms.
It can be tricky to debug issues happening during this small random delay.
Use this build option to force the delay.
This commit is contained in:
Cédric Bellegarde 2023-10-09 10:38:33 +02:00 committed by Niels De Graef
parent 60d2d63d36
commit 8164b5034e
3 changed files with 18 additions and 0 deletions

View file

@ -70,3 +70,9 @@ option(
value: 'enabled',
description: 'Support Microsoft-proprietary TNEF attachments.'
)
option(
'delayed_replay_queue',
type: 'boolean',
value: false,
description: 'Add delay in session opening (for debug purpose only)'
)

View file

@ -1030,6 +1030,12 @@ private class Geary.ImapEngine.MinimalFolder : Geary.Folder, Geary.FolderSupport
Imap.FolderSession? session = null;
try {
#if WITH_DELAYED_REPLAY_QUEUE
// When folder session is claimed, that can lock for some ms.
// It can be tricky to debug issues happening during this small
// random delay. Use this build option to force the delay.
yield Geary.Scheduler.sleep_async(1);
#endif
session = yield this._account.claim_folder_session(
this.path, cancellable
);

View file

@ -365,6 +365,12 @@ if libytnef.found()
]
endif
if get_option('delayed_replay_queue')
engine_vala_args += [
'-D', 'WITH_DELAYED_REPLAY_QUEUE'
]
endif
engine_lib = static_library('geary-engine',
engine_sources,
dependencies: engine_dependencies,