fix command arg name for sqlite database

pull/153/head
aria1th 2023-10-20 19:07:14 +09:00
parent 74a8dc88be
commit 7be6f47849
2 changed files with 5 additions and 5 deletions

View File

@ -7,12 +7,12 @@ from sqlalchemy.orm import declarative_base
from modules import scripts
from modules import shared
if hasattr(shared.cmd_opts, "sqlite_file"):
if hasattr(shared.cmd_opts, "agent_scheduler_sqlite_file"):
# if relative path, join with basedir
if not os.path.isabs(shared.cmd_opts.sqlite_file):
db_file = os.path.join(scripts.basedir(), shared.cmd_opts.sqlite_file)
if not os.path.isabs(shared.cmd_opts.agent_scheduler_sqlite_file):
db_file = os.path.join(scripts.basedir(), shared.cmd_opts.agent_scheduler_sqlite_file)
else:
db_file = os.path.abspath(shared.cmd_opts.sqlite_file)
db_file = os.path.abspath(shared.cmd_opts.agent_scheduler_sqlite_file)
print(f"Using sqlite file: {db_file}")

View File

@ -1,7 +1,7 @@
# preload.py is used for cmd line arguments
def preload(parser):
parser.add_argument(
"--sqlite-file",
"--agent-scheduler-sqlite-file",
help="sqlite file to use for the database connection. It can be abs or relative path(from base path) default: task_scheduler.sqlite3",
default="task_scheduler.sqlite3",
)