Coverage for django_napse/core/tasks/order_process_executor.py: 64%
11 statements
« prev ^ index » next coverage.py v7.4.3, created at 2024-03-12 13:49 +0000
« prev ^ index » next coverage.py v7.4.3, created at 2024-03-12 13:49 +0000
1# from django_napse.core.models import Order
2from django_napse.core.tasks.base_tasks import BaseTask
5class OrderProcessExecutorTask(BaseTask):
6 name = "order_process_executor"
7 interval_time = 5 # Impossible to make dynamic modification because of celery
9 def run(self):
10 """Run TASK.
12 Process orders from bots to make buy/sell on binance.
13 """
14 print("OrderProcessExecutorTask")
15 if not self.avoid_overlap(verbose=True):
16 print("skipped")
17 return
18 # for order in Order.objects.filter(status="pending", completed=True):
19 # order = processor.process_order(order)
22OrderProcessExecutorTask().delete_task()
23OrderProcessExecutorTask().register_task()