Commit Graph

58 Commits

Author SHA1 Message Date
Deluan 51e07d4cb5 Add log.IsGreaterOrEqualTo, that take into consideration path-scoped log levels 2023-12-25 16:35:16 -05:00
Deluan bbb9461000 Increase max Server-Sent Events' ID 2023-04-04 10:46:57 -04:00
Deluan de816e8e5d Fix lint error 2023-04-03 11:15:46 -04:00
Deluan b22d0366d5 Use channels for EventStream instead of diodes 2023-04-03 10:51:24 -04:00
Deluan d6dd0aaae7 Close SSE connection on write error 2023-04-02 18:40:58 -04:00
Deluan e6bfa2bb0b Convert our usage of go-diodes into a simplified, generic version 2023-04-01 21:53:45 -04:00
Deluan 1c7fb74a1d Fix writeEvents race condition.
This required removing the compress middleware from the /events route.
2023-04-01 20:54:15 -04:00
Deluan 83ae2ba3e6 Fix race condition 2023-04-01 18:40:37 -04:00
Deluan e89cdf6199 Fix flaky tests 2023-03-30 09:25:18 -04:00
Deluan 628fd69d3d Fix race condition 2023-03-29 15:17:34 -04:00
Deluan 1d00d1e986 Fix `writeEvent` function.
It would not send anything if the `ResponseWriter` was not a `http.Flusher`, and it was leaking channels with `time.After`
2023-03-29 15:04:40 -04:00
Deluan 0ce750d469 Update golangci-lint and fix lint errors 2023-02-02 11:10:28 -05:00
Deluan 5943e8f953 Rename log.LevelCritical to log.LevelFatal 2022-12-21 14:53:36 -05:00
Deluan f206d81afd Some cleanup, fixes typos and grammar errors 2022-12-06 20:09:03 -05:00
Deluan 76517cab12 Fix potential nil pointer dereference 2022-11-04 10:39:25 -04:00
Deluan db67c1277e Fix error comparisons 2022-09-30 18:54:25 -04:00
Deluan 4cf43ed735 Only compute version once 2022-09-14 21:09:39 -04:00
Deluan d613b19306 Simplify Singleton usage by leveraging Go 1.18's generics 2022-07-27 12:15:05 -04:00
Deluan 31882abf6f Upgrade Ginkgo to V2 2022-07-26 16:53:17 -04:00
Deluan ed286c7103 Don't rely on goroutines to send keepalive events 2021-07-01 13:31:46 -04:00
Deluan 0c2ca2a5e4 Assign event ids in the main loop, to avoid out-of-order events 2021-07-01 10:58:41 -04:00
Deluan 5bd33455a1 Fix deadlock situation when events are sent too fast to the broker 2021-07-01 10:42:00 -04:00
Deluan 743e469795 Use singleton in other places as well 2021-06-21 18:59:26 -04:00
Deluan 877f01bd38 Show notification if server is updated 2021-06-21 13:48:39 -04:00
Deluan 86271f0412 Optimize refresh events for scrobble endpoint 2021-06-16 10:23:34 -04:00
Deluan b65e76293a Only send events to clients who need it
- User events (star, rating, plays) only sent to same user
- Don't send to the client (browser window) that originated the event
2021-06-15 18:59:26 -04:00
Deluan 8383527aab Only refetch changed resources when receive a "refreshResource" event 2021-06-15 16:12:13 -04:00
Deluan 7f85ecd515 Trigger a UI refresh when the scanner finds changes.
Closes #1025
2021-06-09 21:02:20 -04:00
Deluan abaecf2b88 Add Nginx header to not buffer SSE connection
This should allow the Activity Panel, that uses a Server-Side Events/ Event Source connection, to work with default Nginx reverse proxy configuration.
2021-04-20 10:16:20 -04:00
harshavardhanpb 5128c049d7
Rename diodo_test.go to diode_test.go (#956)
Simple typo fix
2021-03-31 15:41:38 -04:00
Deluan cfc9162729 Use a Waiter diode, to avoid constant CPU usage. Fixes #777 2021-02-13 12:08:32 -05:00
Deluan 6ee45a9ccc Move project to Navidrome GitHub organization 2021-02-06 21:46:35 -05:00
Deluan 26f838167e Add tests to diode 2021-02-04 15:42:08 -05:00
Deluan c7af3b8256 Add test to Event 2021-02-04 12:43:46 -05:00
Deluan 7adacbac0d Removed event.type from SSE, as it was causing the browser to hang.
Needs more investigation, but for now, back to the simple message format
2021-02-04 12:37:06 -05:00
Deluan 905c685696 Use diodes instead of channels in SSE broker 2021-02-02 18:55:08 -05:00
Deluan 861b406575 Use new simplified `uuid.NewString()` syntax 2021-02-01 01:22:31 -05:00
Deluan cdae4347a6 Make ServerStart variable global 2020-12-21 11:39:38 -05:00
Deluan 8c063c4f0c Removed unused variable 2020-12-21 10:01:37 -05:00
Deluan 14b060a42a Only close connection if the write times out 2020-12-20 15:21:46 -05:00
Deluan 1d338417e9 Make `done` channel buffered 2020-12-13 11:58:00 -05:00
Deluan d685aefab3 Don't ever stop the `listen` go routine 2020-12-12 23:04:50 -05:00
Deluan e27d917bd4 Forgot to allocate `done` channel 2020-12-12 21:10:43 -05:00
Deluan 8b92796a5c Disconnect the client if the output buffer fills up 2020-12-12 18:26:30 -05:00
Deluan 17833cd9d2 Make names more consistent 2020-12-12 13:46:36 -05:00
Deluan e2969aa34c Use non-blocking event sending 2020-12-12 13:35:49 -05:00
Deluan a8c5fa6d49 Fix file descriptor leak in SSE implementation.master
See https://github.com/deluan/navidrome/issues/446#issuecomment-736296465
2020-12-01 09:24:44 -05:00
Deluan b6c578e3a2 Change format of events sent by server, leveraging event type and id 2020-11-25 20:46:21 -05:00
Deluan 3e8bee4f65 Make eventStream connection/reconnection more reliable
Also more logs on the server
2020-11-20 20:27:30 -05:00
Deluan a1dcb9a4e3 Show folders scanned instead of files scanned 2020-11-16 00:36:12 -05:00