|
|
|
@ -6,6 +6,7 @@ from cookiespool.config import *
|
|
|
|
|
from cookiespool.generator import * |
|
|
|
|
from cookiespool.tester import * |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Scheduler(object): |
|
|
|
|
@staticmethod |
|
|
|
|
def valid_cookie(cycle=CYCLE): |
|
|
|
@ -41,6 +42,10 @@ class Scheduler(object):
|
|
|
|
|
app.run(host=API_HOST, port=API_PORT) |
|
|
|
|
|
|
|
|
|
def run(self): |
|
|
|
|
if API_PROCESS: |
|
|
|
|
api_process = Process(target=Scheduler.api) |
|
|
|
|
api_process.start() |
|
|
|
|
|
|
|
|
|
if GENERATOR_PROCESS: |
|
|
|
|
generate_process = Process(target=Scheduler.generate_cookie) |
|
|
|
|
generate_process.start() |
|
|
|
@ -48,8 +53,3 @@ class Scheduler(object):
|
|
|
|
|
if VALID_PROCESS: |
|
|
|
|
valid_process = Process(target=Scheduler.valid_cookie) |
|
|
|
|
valid_process.start() |
|
|
|
|
|
|
|
|
|
if API_PROCESS: |
|
|
|
|
api_process = Process(target=Scheduler.api) |
|
|
|
|
api_process.start() |
|
|
|
|
|
|
|
|
|