mirror of
https://github.com/tiennm99/DocsGPT.git
synced 2026-10-13 16:14:10 +00:00
fix(cli): review pass on the docsgpt command
- The image pins DOCSGPT_HOME=/app: it ships no checkout, so the data home no longer depends on the working directory. - api, worker, beat and migrate print the data home and env file they resolved, so an API and a worker started from different directories show it. - The worker passes -Q only when asked; a bare worker consumes every configured queue, which honours EMBEDDINGS_QUEUE and DOCUMENT_PARSE_QUEUE. - The worker runs through celery.start and returns its exit code; click usage errors print usage and exit 2 instead of a traceback. - Windows: solo pool and no embedded scheduler (celery rejects -B there), with a pointer to the new `docsgpt beat` command, which runs the scheduler on its own. - prefetch_models and verify_offline parse their arguments, so --help is help rather than a model name. - A DOCSGPT_ENV_FILE that is not a file raises instead of booting with defaults.
This commit is contained in:
1 parent
f6f0d49452
commit
3036ece3ff
8 files changed
+134
-23
No files matched your search
@@ -43,5 +43,8 @@ def env_file() -> Path:
|
||||
"""The ``.env`` file settings load: ``DOCSGPT_ENV_FILE``, else ``<home>/.env``."""
|
||||
configured = os.environ.get(ENV_FILE_ENV)
|
||||
if configured:
|
||||
return Path(configured).expanduser()
|
||||
path = Path(configured).expanduser()
|
||||
if not path.is_file():
|
||||
raise FileNotFoundError(f"{ENV_FILE_ENV} is set to {path}, which is not a file")
|
||||
return path
|
||||
return home_dir() / ".env"
|
||||
Reference in new issue
Block a user