+ Fix wrong docker time

+ Temp add debug msg
This commit is contained in:
yiekheng 2025-10-04 10:41:59 +08:00
parent 45f33a046d
commit 214612a7db
2 changed files with 9 additions and 3 deletions

View File

@ -10,7 +10,8 @@ logging.basicConfig(
logging.getLogger("httpx").setLevel(logging.WARNING)
logger = logging.getLogger(__name__)
api_url = 'https://api.luckytown888.net'
# api_url = 'https://api.luckytown888.net'
api_url = 'https://localhost:3000'
max_threading = 1
def transfer(data: dict):
@ -25,7 +26,9 @@ while True:
weekday = int(datetime.now().strftime("%w"))
hour = int(datetime.now().strftime("%H"))
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')
items = json.loads(response.text)
total_items = len(items) if isinstance(items, list) else 0
@ -34,4 +37,4 @@ while True:
else:
with ThreadPoolExecutor(max_workers=max_threading) as executor:
list(tqdm(executor.map(transfer, items), total=total_items, desc="Processing data"))
time.sleep(1)
time.sleep(1)

View File

@ -60,10 +60,13 @@ services:
- PYTHONUNBUFFERED=1
volumes:
- .:/app
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
networks:
- cm-network
depends_on:
- api-server
- web-view
networks: