mirror of
https://github.com/iv-org/invidious.git
synced 2024-09-19 02:05:45 +05:30
Compare commits
2 Commits
b0bda6b01d
...
5b90109782
Author | SHA1 | Date | |
---|---|---|---|
|
5b90109782 | ||
|
3850739d7f |
@ -47,9 +47,9 @@ class Invidious::Jobs::NotificationJob < Invidious::Jobs::BaseJob
|
||||
begin
|
||||
loop do
|
||||
notification = notification_channel.receive
|
||||
notify_mutex.lock
|
||||
to_notify[notification.channel_id] << notification
|
||||
notify_mutex.unlock
|
||||
notify_mutex.synchronize do
|
||||
to_notify[notification.channel_id] << notification
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -58,10 +58,11 @@ class Invidious::Jobs::NotificationJob < Invidious::Jobs::BaseJob
|
||||
loop do
|
||||
begin
|
||||
LOGGER.debug("NotificationJob: waking up")
|
||||
notify_mutex.lock
|
||||
cloned = to_notify.clone
|
||||
to_notify.clear
|
||||
notify_mutex.unlock
|
||||
cloned = {} of String => Set(VideoNotification)
|
||||
notify_mutex.synchronize do
|
||||
cloned = to_notify.clone
|
||||
to_notify.clear
|
||||
end
|
||||
|
||||
cloned.each do |channel_id, notifications|
|
||||
if notifications.empty?
|
||||
|
Loading…
Reference in New Issue
Block a user