wstkeys/services/red.py

37 lines
1.1 KiB
Python

import datetime
from API.rok import download_products, download_prices
from API.rokky import decrypt_and_unpack, add_product, update_prices
from services.orders_rokky import rok_orders
def run_task():
print("REDs start download_prices:!", datetime.datetime.now())
download_prices()
decrypt_and_unpack("prices")
print("START update_prices")
update_prices()
print("END update_prices", datetime.datetime.now())
print("REDs download_prices:!", datetime.datetime.now())
def run_task1():
download_products()
decrypt_and_unpack("products")
add_product()
print("REDs download__product:", datetime.datetime.now())
def run_task2():
try:
print("START run_task2")
rok_orders()
print("END run_task2", datetime.datetime.now())
except Exception as e:
print("ERROR run_task2:", e)
def run_task3():
try:
print("START run_task3")
update_prices()
print("END run_task3", datetime.datetime.now())
except Exception as e:
print("ERROR run_task3:", e)