Merge pull request #275 from SamR1/disable-worker-entry-point

Disable worker entry point
This commit is contained in:
Sam 2022-11-27 09:18:13 +01:00 committed by GitHub
commit 2187f172bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 2 deletions

View File

@ -396,7 +396,7 @@ For instance, copy and update ``.env`` file from ``.env.example`` and source the
.. code-block:: bash .. code-block:: bash
$ fittrackee_worker --processes 2 $ flask worker --processes 2
.. note:: .. note::
| To start application and workers with **systemd** service, see `Deployment <installation.html#deployment>`__ | To start application and workers with **systemd** service, see `Deployment <installation.html#deployment>`__

View File

@ -81,6 +81,14 @@ def upgrade_db() -> None:
upgrade(directory=BASEDIR + '/migrations') upgrade(directory=BASEDIR + '/migrations')
def worker() -> None:
raise SystemExit(
"Error: this command is disabled, "
"it will be removed in a next version.\n"
"Please use flask-dramatiq CLI instead ('flask worker')."
)
def main() -> None: def main() -> None:
options = {'bind': f'{HOST}:{PORT}', 'workers': WORKERS} options = {'bind': f'{HOST}:{PORT}', 'workers': WORKERS}
StandaloneApplication(app, options).run() StandaloneApplication(app, options).run()

View File

@ -70,7 +70,7 @@ types-redis = "^4.3"
[tool.poetry.scripts] [tool.poetry.scripts]
fittrackee = 'fittrackee.__main__:main' fittrackee = 'fittrackee.__main__:main'
fittrackee_worker = 'flask_dramatiq:worker' fittrackee_worker = 'fittrackee.__main__:worker' # disabled
ftcli = 'fittrackee.cli:cli' ftcli = 'fittrackee.cli:cli'
fittrackee_set_admin = 'fittrackee.__main__:set_admin' # deprecated fittrackee_set_admin = 'fittrackee.__main__:set_admin' # deprecated
fittrackee_upgrade_db = 'fittrackee.__main__:upgrade_db' # deprecated fittrackee_upgrade_db = 'fittrackee.__main__:upgrade_db' # deprecated