diff options
Diffstat (limited to 'src/invidious.cr')
| -rw-r--r-- | src/invidious.cr | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/invidious.cr b/src/invidious.cr index 6b1be6ed..0913a137 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -83,9 +83,13 @@ 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) + refresh_channels(PG_DB, limit, offset) end end |
