ED_LRR/celery/celery_test.py

32 lines
755 B
Python

# -*- coding: utf-8 -*-
from celery import Celery
import _ed_lrr
import os
os.environ.setdefault("CELERY_CONFIG_MODULE", "celeryconfig")
app = Celery("ed_lrr")
app.config_from_envvar("CELERY_CONFIG_MODULE")
@app.task(bind=True)
def route(self, hops, jmp_range):
def callback(state):
print("PRC: ", state.get("prc_done", 0.0))
self.update_state(state="PROGRESS", meta=state)
self.update_state(state="RUNNING", meta={})
return _ed_lrr.route(
hops,
jmp_range,
None,
"bfs",
True,
False,
False,
False,
0.0,
None,
r"C:\Users\Earthnuker\AppData\Local\ED_LRR\data\stars.csv",
0,
callback,
)