v1.7.0-beta2

This commit is contained in:
lanqian528 2024-11-06 18:44:49 +08:00
parent 4e02d7cd21
commit 997ea02a3a
3 changed files with 6 additions and 6 deletions

View File

@ -2,7 +2,7 @@ import asyncio
import types
from apscheduler.schedulers.asyncio import AsyncIOScheduler
from fastapi import Request, Depends, HTTPException, Form, Security
from fastapi import Request, HTTPException, Form, Security
from fastapi.responses import HTMLResponse, StreamingResponse, JSONResponse
from fastapi.security import HTTPAuthorizationCredentials
from starlette.background import BackgroundTask
@ -89,7 +89,7 @@ async def upload_post(text: str = Form(...)):
for line in lines:
if line.strip() and not line.startswith("#"):
globals.token_list.append(line.strip())
with open("../data/token.txt", "a", encoding="utf-8") as f:
with open(globals.TOKENS_FILE, "a", encoding="utf-8") as f:
f.write(line.strip() + "\n")
logger.info(f"Token count: {len(globals.token_list)}, Error token count: {len(globals.error_token_list)}")
tokens_count = len(set(globals.token_list) - set(globals.error_token_list))
@ -100,7 +100,7 @@ async def upload_post(text: str = Form(...)):
async def upload_post():
globals.token_list.clear()
globals.error_token_list.clear()
with open("../data/token.txt", "w", encoding="utf-8") as f:
with open(globals.TOKENS_FILE, "w", encoding="utf-8") as f:
pass
logger.info(f"Token count: {len(globals.token_list)}, Error token count: {len(globals.error_token_list)}")
tokens_count = len(set(globals.token_list) - set(globals.error_token_list))
@ -117,7 +117,7 @@ async def error_tokens():
async def add_token(token: str):
if token.strip() and not token.startswith("#"):
globals.token_list.append(token.strip())
with open("../data/token.txt", "a", encoding="utf-8") as f:
with open(globals.TOKENS_FILE, "a", encoding="utf-8") as f:
f.write(token.strip() + "\n")
logger.info(f"Token count: {len(globals.token_list)}, Error token count: {len(globals.error_token_list)}")
tokens_count = len(set(globals.token_list) - set(globals.error_token_list))

View File

@ -1,7 +1,7 @@
import json
import random
from fastapi import Request, HTTPException, Depends, Security
from fastapi import Request, HTTPException, Security
from fastapi.responses import Response
from fastapi.security import HTTPAuthorizationCredentials

View File

@ -1 +1 @@
1.7.0-beta1
1.7.0-beta2