d/tt-rss.service: Fix daemon failing during boot and elsewhere
Eventhough tt-rss.service has Wants= and After= on postgresql.service, postgresql is has Type=forking model and I don't believe it notifies systemd after startup. Hence after spawning postgresql successfully, tt-rss.service is immediately started. However, postgresql may be doing house keeping duties like recovering from journal/log etc. and may not be accepting connections. If postgresql.service started quickly, tt-rss.service works. Otherwise, it fails permanently (for that system boot).
This bug also happens in other cases. When database is being restarted for a security upgrade (say with needsrestart package like in FreedomBox) and if tt-rss tries to query at that time, tt-rss will fail permanently.
The reason for both the bugs is that tt-rss code has exit(101) if db connection fails. It does not try again in the next scheduled time after waiting 120 seconds.
Both the situations are more prominent in case of slow machine like single board computers running on SD cards like in case of FreedomBox.
Signed-off-by: Sunil Mohan Adapa sunil@medhas.org