Return the directory that holds daemon runtime artifacts. Holds ``daemon.sock``, ``daemon.pid``, ``daemon.log``. Kept separate from the user-settings dir so that (e.g. in Docker) the socket can live on the container's native filesystem while ``global_settings.yml`` lives on a bind m
()
| 14 | |
| 15 | |
| 16 | def daemon_runtime_dir() -> Path: |
| 17 | """Return the directory that holds daemon runtime artifacts. |
| 18 | |
| 19 | Holds ``daemon.sock``, ``daemon.pid``, ``daemon.log``. Kept separate from |
| 20 | the user-settings dir so that (e.g. in Docker) the socket can live on the |
| 21 | container's native filesystem while ``global_settings.yml`` lives on a |
| 22 | bind mount. |
| 23 | |
| 24 | Override with ``COCOINDEX_CODE_RUNTIME_DIR``. Defaults to |
| 25 | :func:`user_settings_dir` for backward compatibility — non-Docker users |
| 26 | see identical behavior to before the split. |
| 27 | """ |
| 28 | override = os.environ.get("COCOINDEX_CODE_RUNTIME_DIR") |
| 29 | if override: |
| 30 | return Path(override) |
| 31 | return user_settings_dir() |
| 32 | |
| 33 | |
| 34 | def connection_family() -> str: |