+ Fix wrong docker time
+ Temp add debug msg
This commit is contained in:
parent
45f33a046d
commit
214612a7db
@ -10,7 +10,8 @@ logging.basicConfig(
|
|||||||
logging.getLogger("httpx").setLevel(logging.WARNING)
|
logging.getLogger("httpx").setLevel(logging.WARNING)
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
api_url = 'https://api.luckytown888.net'
|
# api_url = 'https://api.luckytown888.net'
|
||||||
|
api_url = 'https://localhost:3000'
|
||||||
max_threading = 1
|
max_threading = 1
|
||||||
|
|
||||||
def transfer(data: dict):
|
def transfer(data: dict):
|
||||||
@ -25,7 +26,9 @@ while True:
|
|||||||
weekday = int(datetime.now().strftime("%w"))
|
weekday = int(datetime.now().strftime("%w"))
|
||||||
hour = int(datetime.now().strftime("%H"))
|
hour = int(datetime.now().strftime("%H"))
|
||||||
minutes = int(datetime.now().strftime("%M"))
|
minutes = int(datetime.now().strftime("%M"))
|
||||||
if weekday == 3 and (hour >= 21 and hour < 22) and minutes >= 32:
|
print(f'weekday: {weekday}, hour: {hour}, minutes: {minutes}')
|
||||||
|
if weekday == 6 and (hour >= 9 and hour < 22):
|
||||||
|
print('hi')
|
||||||
response = requests.get(f'{api_url}/user')
|
response = requests.get(f'{api_url}/user')
|
||||||
items = json.loads(response.text)
|
items = json.loads(response.text)
|
||||||
total_items = len(items) if isinstance(items, list) else 0
|
total_items = len(items) if isinstance(items, list) else 0
|
||||||
@ -34,4 +37,4 @@ while True:
|
|||||||
else:
|
else:
|
||||||
with ThreadPoolExecutor(max_workers=max_threading) as executor:
|
with ThreadPoolExecutor(max_workers=max_threading) as executor:
|
||||||
list(tqdm(executor.map(transfer, items), total=total_items, desc="Processing data"))
|
list(tqdm(executor.map(transfer, items), total=total_items, desc="Processing data"))
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
|||||||
@ -60,10 +60,13 @@ services:
|
|||||||
- PYTHONUNBUFFERED=1
|
- PYTHONUNBUFFERED=1
|
||||||
volumes:
|
volumes:
|
||||||
- .:/app
|
- .:/app
|
||||||
|
- /etc/timezone:/etc/timezone:ro
|
||||||
|
- /etc/localtime:/etc/localtime:ro
|
||||||
networks:
|
networks:
|
||||||
- cm-network
|
- cm-network
|
||||||
depends_on:
|
depends_on:
|
||||||
- api-server
|
- api-server
|
||||||
|
- web-view
|
||||||
|
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user