sub-muxer icon indicating copy to clipboard operation
sub-muxer copied to clipboard

Implement a Queue System

Open mohdsabahat opened this issue 3 years ago • 5 comments

A queue system is required to process the muxing commands in queue for Avoiding system memory overflow.

mohdsabahat avatar Sep 07 '21 13:09 mohdsabahat

Could you provide some more details?

ausaafnabi avatar Oct 03 '21 10:10 ausaafnabi

Could you provide some more details?

Since muxing is resource greedy process all the request by the users should be first entered in a queue and then the process should be executed in order one at a time.. This will also prevent memory overflow problem on heroku when multiple users send requests at same time!

mohdsabahat avatar Oct 03 '21 11:10 mohdsabahat

I have looked into the codebase. Based on my understanding there are 2 types of muxing that bot is doing. It would become a bit problematic since the function calls are directly on user input.

Therefore, I plan to create use decorator to pass whole muxing function into a task queue. Will the approach be fine considering that i don't have prior understanding of how you are muxing?

Suggestions would be appreciated.

ausaafnabi avatar Oct 03 '21 16:10 ausaafnabi

Yeah.. i think we would have to do with decorators if we don't want to Rewrite a big part of the code..

Will the approach be fine considering that i don't have prior understanding of how you are muxing?

I didn't got you here... When the user commands for muxing, file is fetched from database and muxed using ffmpeg through a subprocess call (the code as is here)

What i initially had in mind to put all request in the queue and later run the queue. But yeah that would mean a major Rewrite.. so your idea seems viable

mohdsabahat avatar Oct 05 '21 17:10 mohdsabahat

Great, This was the information required to go through the process. Thanks I will PR asap.

ausaafnabi avatar Oct 06 '21 03:10 ausaafnabi