mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-08-14.git
synced 2024-08-15 00:53:20 +00:00
Update refresh_channels to properly utilize workers
This commit is contained in:
parent
f588132cad
commit
f3c7409d72
2 changed files with 33 additions and 22 deletions
|
@ -83,15 +83,7 @@ crawl_threads.times do
|
|||
end
|
||||
end
|
||||
|
||||
total_channels = PG_DB.query_one("SELECT count(*) FROM channels", as: Int64)
|
||||
channel_threads.times do |i|
|
||||
limit = total_channels / channel_threads
|
||||
offset = limit.not_nil! * i
|
||||
|
||||
spawn do
|
||||
refresh_channels(PG_DB, limit, offset)
|
||||
end
|
||||
end
|
||||
refresh_channels(PG_DB, channel_threads)
|
||||
|
||||
video_threads.times do |i|
|
||||
spawn do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue