bbb
This commit is contained in:
parent
ee3c1d47bd
commit
d7ba907f66
1 changed files with 13 additions and 16 deletions
|
@ -556,24 +556,21 @@ def thumbnail_thread(pid):
|
||||||
|
|
||||||
cpu = cpu_percent()
|
cpu = cpu_percent()
|
||||||
|
|
||||||
if cpu > 7:
|
if cpu > 70:
|
||||||
print('wtf', flush=True)
|
print('wtf', flush=True)
|
||||||
# with open('under_attack', 'r') as f: content = f.read()
|
with open('under_attack', 'r') as f: content = f.read()
|
||||||
|
|
||||||
# with open('under_attack', 'w') as f:
|
with open('under_attack', 'w') as f:
|
||||||
# if content != "yes":
|
if content != "yes":
|
||||||
# f.write("yes")
|
f.write("yes")
|
||||||
# ma = ModAction(
|
ma = ModAction(
|
||||||
# kind="enable_under_attack",
|
kind="enable_under_attack",
|
||||||
# user_id=AUTOJANNY_ID,
|
user_id=AUTOJANNY_ID,
|
||||||
# )
|
)
|
||||||
# g.db.add(ma)
|
g.db.add(ma)
|
||||||
# g.db.commit()
|
g.db.commit()
|
||||||
# data='{"value":"under_attack"}'
|
data='{"value":"under_attack"}'
|
||||||
|
requests.patch(f'https://api.cloudflare.com/client/v4/zones/{CF_ZONE}/settings/security_level', headers=CF_HEADERS, data=data)
|
||||||
# response = str(requests.patch(f'https://api.cloudflare.com/client/v4/zones/{CF_ZONE}/settings/security_level', headers=CF_HEADERS, data=data))
|
|
||||||
# if response == "<Response [200]>": return {"message": "Under attack mode enabled!"}
|
|
||||||
# return {"error": "Failed to enable under attack mode."}
|
|
||||||
|
|
||||||
def expand_url(post_url, fragment_url):
|
def expand_url(post_url, fragment_url):
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue