UltimaScraper icon indicating copy to clipboard operation
UltimaScraper copied to clipboard

Just a ?

Open James-MF-Thomas opened this issue 6 years ago • 1 comments

Still getting "Too many files open" error

could you fix this by using a context manager which automatically calls pool.terminate, or create a pool outside the loop just once, and then send tasks to the processes inside?

pool = multiprocessing.Pool(nprocess) # initialise your pool for nprocess in process_per_cycle:
    ...       
    pool.map(cycle, offsets) # delegate work inside your loop

pool.close() # shut down the pool

forgive me if this dated or irrelevant, it's advice I found and am asking before trying myself

James-MF-Thomas avatar Nov 16 '20 09:11 James-MF-Thomas

ended up reinstalling python and homebrew, havent seen the error in three cycles as of yet. so prob not necessary

James-MF-Thomas avatar Nov 17 '20 21:11 James-MF-Thomas