canonical / snapd-desktop-integration

User session helpers for snapd
GNU General Public License v3.0
15 stars 10 forks source link

Don't launch several "threads" for same change #90

Closed sergio-costas closed 1 month ago

sergio-costas commented 1 month ago

When a change is processed, a timeout is set to continue monitoring it. Unfortunately, when a change is sent again to the program, a new timeout is set, thus having two "pseudothreads" monitoring the same change.

This patch checks if there is already a timeout for a change, and avoids creating a new timeout in that case, because the current one will already manage new changes.

sergio-costas commented 1 month ago

@robert-ancell Can you review this when you have some spare time, please?