diff options
| author | 2020-11-10 17:24:39 +0100 | |
|---|---|---|
| committer | 2020-11-10 18:33:50 +0100 | |
| commit | b4220a32bf6e6c3e46392e443979acdff8979e50 (patch) | |
| tree | 76fc828cf10fbad95799a35e0ac0b21f4f8f2216 /tests/_autospec.py | |
| parent | Voice Gate: correct after-delay message delete methodology (diff) | |
Voice Gate: define atomic `_delete_ping` function
The code for ping deletion was duplicated in two places. In this commit,
we move it into a helper function, and apply a lock to make each
transaction atomic.
This means that if two coroutines try to call the function, the first
has to finish before the second can begin. This avoids the following:
Coro1: Message in cache? Yes.
Coro1: Send delete request. Yield control (await).
Coro2: Message in cache? Yes.
Now Coro2 has to wait for Coro1 to finish. Therefore it will always
find the `NO_MSG` signal, and not attempt the deletion.
Co-authored-by: MarkKoz <[email protected]>
Co-authored-by: Sebastiaan Zeeff <[email protected]>
Co-authored-by: Daniel Brown <[email protected]>
Diffstat (limited to 'tests/_autospec.py')
0 files changed, 0 insertions, 0 deletions