sureshfizzy / CineSync

CineSync is a Python based library management tool designed to organize debrid & local libraries without the support of Sonarr & Radarr
81 stars 7 forks source link

DB_THROTTLE_RATE not working as intended? #22

Closed snucker-fod closed 2 months ago

snucker-fod commented 2 months ago

It seems that the the DB_THROTTLE_RATE is not being applied in combination with the DB_BATCH_SIZE. It is processing 10 requests per second, IE: 1 batch of 10 per second.

sureshfizzy commented 2 months ago

Was it the same settings as you mentioned earlier?

sureshfizzy commented 2 months ago

If My understanding is not wrong,

DB_THROTTLE_RATE = 1: Limits processing to 1 batch per second. DB_BATCH_SIZE = 10: Each batch contains 10 files, so you are processing 10 files per second in a single batch.

You want 1 file (not batch) to be processed per second, meaning with DB_BATCH_SIZE=10, the script should take 10 seconds to process one batch, correct ?

If you keep DB_THROTTLE_RATE = 1 and set DB_BATCH_SIZE = 10, the system will process one batch of 10 files every second. This means you’re effectively processing 10 files per second.

By setting DB_BATCH_SIZE to 1, you'll ensure that each batch contains only one file, allowing the script to adhere to the DB_THROTTLE_RATE of 1 batch per second. This way, you'll achieve the desired rate of processing 1 file per second and vice versa.

snucker-fod commented 2 months ago

Gotcha, just wasn't clear with the description of the variables.