xgi / castero

TUI podcast client for the terminal
MIT License
616 stars 37 forks source link

Freeze upon wake from suspend #186

Open plum opened 2 years ago

plum commented 2 years ago

Castero freezes when I wake from suspend.

I do at times fall asleep in evenings when listening. So suspend is important to keep active.

When I resume the computer, Castro window is unresponsive, and I have to quit the window to relaunch Castero. Upon relaunching, no changes to the queue (episodes added or played) are kept, nor are new feeds which are added before suspend kicks in, saved.


Running arch on linux-lts 5.15.19-1, operating wayland with Sway.

This is my swayidle config:

timeout 600 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"'  
timeout 1800 'systemctl suspend'

Thanks for reading this issue, and your kind consideration. John

xgi commented 2 years ago

I can try and take a look at the cause, but something you can do to avoid queue & feed changes not being saved after this happens is to enable restrict_memory_usage in the config. That will cause changes to be written to disk immediately.

plum commented 2 years ago

Thanks. I have now changed the restrict_memory_usage to True, as advised.

plum commented 2 years ago

I have additional information on the issue: When Castero freezes upon wake form suspend, and I relaunch Castero, the queue is cleared, and all queued items vanish. This is true, after since changing restrictmemory usage to TRUE.

On the other hand, if I simply press 'q' to quite without a freeze, and relaunch Castero, the queue items are preserved.

Regards, John

xgi commented 2 years ago

Ah, I reviewed the code and found that option doesn't apply to the queue, which is always only saved in memory until normal termination. Sorry for the incorrect guidance.