Update start-hyperopt-worker.py
This commit is contained in:
parent
c6102a55af
commit
d46eaae7a3
@ -2,8 +2,7 @@
|
|||||||
import multiprocessing
|
import multiprocessing
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
|
||||||
import shlex
|
|
||||||
PROC_COUNT = multiprocessing.cpu_count() - 1
|
PROC_COUNT = multiprocessing.cpu_count() - 1
|
||||||
DB_NAME = 'freqtrade_hyperopt'
|
DB_NAME = 'freqtrade_hyperopt'
|
||||||
WORK_DIR = os.path.join(
|
WORK_DIR = os.path.join(
|
||||||
@ -20,9 +19,9 @@ command = [
|
|||||||
'--mongo=127.0.0.1:1234/{}'.format(DB_NAME),
|
'--mongo=127.0.0.1:1234/{}'.format(DB_NAME),
|
||||||
'--poll-interval=0.1',
|
'--poll-interval=0.1',
|
||||||
'--workdir={}'.format(WORK_DIR),
|
'--workdir={}'.format(WORK_DIR),
|
||||||
'--max-jobs=100000',
|
|
||||||
'--max-consecutive-failures=100000',
|
|
||||||
]
|
]
|
||||||
def run(command):
|
processes = [subprocess.Popen(command) for i in range(PROC_COUNT)]
|
||||||
subprocess.call(command, shell=True))
|
|
||||||
run(command)
|
# Join all workers
|
||||||
|
for proc in processes:
|
||||||
|
proc.wait()
|
||||||
|
Loading…
Reference in New Issue
Block a user