dunst-project / dunst

Lightweight and customizable notification daemon
https://dunst-project.org
Other
4.52k stars 338 forks source link

High CPU usage when show_age_threshold = -1 #1164

Closed bakkeby closed 1 year ago

bakkeby commented 1 year ago

The show_age_threshold can be set to -1 to disable the feature that updates notifications with their age.

In this scenario the queues_get_next_datachange may return -1 to indicate that there is no next wakeup time (e.g. when there are permanent / critical notifications).

The code that calls queues_get_next_datachange should take this scenario into account and not schedule another timeout if -1 is returned.

Addresses #1163.

bakkeby commented 1 year ago

I included some slight refactoring to simplify the code a bit. If you don't like this then I can revert to just returning when timeout_at is -1.

fwsmit commented 1 year ago

Thanks, looks good to me. The simplification makes sense to me as well