fixed datetime in pdata

This commit is contained in:
Ayush Saini 2023-07-28 19:08:16 +05:30 committed by GitHub
parent 70dfbe091e
commit 9466114f91
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -18,7 +18,7 @@ from tools.file_handle import OpenJson
import _ba import _ba
import ba.internal import ba.internal
import json import json
import datetime
from tools.ServerUpdate import checkSpammer from tools.ServerUpdate import checkSpammer
import setting import setting
from datetime import datetime, timedelta from datetime import datetime, timedelta
@ -73,7 +73,7 @@ def get_profiles() -> dict:
if CacheData.profiles == {}: if CacheData.profiles == {}:
try: try:
if os.stat(PLAYERS_DATA_PATH+"profiles.json").st_size > 1000000: if os.stat(PLAYERS_DATA_PATH+"profiles.json").st_size > 1000000:
newpath = f'{PLAYERS_DATA_PATH}profiles-{str(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))}.json' newpath = f'{PLAYERS_DATA_PATH}profiles-{str(datetime.now().strftime("%Y-%m-%d %H:%M:%S"))}.json'
shutil.copyfile(PLAYERS_DATA_PATH + "profiles.json", newpath) shutil.copyfile(PLAYERS_DATA_PATH + "profiles.json", newpath)
profiles = {"pb-sdf": {}} profiles = {"pb-sdf": {}}
print("resetting profiles") print("resetting profiles")