auto-update
This commit is contained in:
parent
69deab63d3
commit
b2eb5b9987
4 changed files with 5 additions and 3 deletions
|
@ -4,7 +4,7 @@ import yaml
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
async def load_config():
|
async def load_config():
|
||||||
config_path = Path(__file__).parent.parent / 'config' / 'db.yaml'
|
config_path = Path(__file__).parent.parent / 'config' / 'sys.yaml'
|
||||||
with open(config_path, 'r') as file:
|
with open(config_path, 'r') as file:
|
||||||
return yaml.safe_load(file)
|
return yaml.safe_load(file)
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# helpers/replicator.py
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
import asyncpg
|
import asyncpg
|
||||||
import yaml
|
import yaml
|
||||||
|
|
|
@ -149,7 +149,7 @@ def kill_remote_server(server):
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
load_env()
|
load_env()
|
||||||
db_config = load_config('db')
|
db_config = load_config('sys')
|
||||||
pool = db_config['POOL']
|
pool = db_config['POOL']
|
||||||
local_ts_id = os.environ.get('TS_ID')
|
local_ts_id = os.environ.get('TS_ID')
|
||||||
|
|
||||||
|
|
|
@ -644,7 +644,7 @@ async def extract_text(file: Union[UploadFile, bytes, bytearray, str, Path], bg_
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if isinstance(file, UploadFile):
|
if isinstance(file, UploadFile):
|
||||||
info("File is an UploadFile object")
|
l.info("File is an UploadFile object")
|
||||||
file_extension = os.path.splitext(file.filename)[1]
|
file_extension = os.path.splitext(file.filename)[1]
|
||||||
temp_file_path = tempfile.mktemp(suffix=file_extension)
|
temp_file_path = tempfile.mktemp(suffix=file_extension)
|
||||||
with open(temp_file_path, 'wb') as buffer:
|
with open(temp_file_path, 'wb') as buffer:
|
||||||
|
|
Loading…
Reference in a new issue