Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move worker script #97

Merged
merged 2 commits into from
Jan 10, 2024
Merged

Move worker script #97

merged 2 commits into from
Jan 10, 2024

Conversation

AlessioBugetti
Copy link
Contributor

@AlessioBugetti AlessioBugetti commented Jan 9, 2024

  • created a worker folder inside core and moved the worker logic to this new folder (app/worker.py -> app/core/worker/settings.py, app/core/worker/functions.py)
  • updated the README.md

Fix #94

@igorbenav igorbenav self-assigned this Jan 9, 2024
@igorbenav igorbenav added the enhancement New feature or request label Jan 9, 2024
@igorbenav igorbenav self-requested a review January 9, 2024 22:48
Copy link
Owner

@igorbenav igorbenav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't forget to run before PR, I'm getting:

fastapi-boilerplate-worker-1  | Traceback (most recent call last):
fastapi-boilerplate-worker-1  |   File "/usr/local/bin/arq", line 8, in <module>
fastapi-boilerplate-worker-1  |     sys.exit(cli())
fastapi-boilerplate-worker-1  |              ^^^^^
fastapi-boilerplate-worker-1  |   File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
fastapi-boilerplate-worker-1  |     return self.main(*args, **kwargs)
fastapi-boilerplate-worker-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^
fastapi-boilerplate-worker-1  |   File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1078, in main
fastapi-boilerplate-worker-1  |     rv = self.invoke(ctx)
fastapi-boilerplate-worker-1  |          ^^^^^^^^^^^^^^^^
fastapi-boilerplate-worker-1  |   File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
fastapi-boilerplate-worker-1  |     return ctx.invoke(self.callback, **ctx.params)
fastapi-boilerplate-worker-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
fastapi-boilerplate-worker-1  |   File "/usr/local/lib/python3.11/site-packages/click/core.py", line 783, in invoke
fastapi-boilerplate-worker-1  |     return __callback(*args, **kwargs)
fastapi-boilerplate-worker-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
fastapi-boilerplate-worker-1  |   File "/usr/local/lib/python3.11/site-packages/arq/cli.py", line 40, in cli
fastapi-boilerplate-worker-1  |     worker_settings_ = cast('WorkerSettingsType', import_string(worker_settings))
fastapi-boilerplate-worker-1  |                                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
fastapi-boilerplate-worker-1  |   File "/usr/local/lib/python3.11/site-packages/arq/utils.py", line 146, in import_string
fastapi-boilerplate-worker-1  |     module = import_module(module_path)
fastapi-boilerplate-worker-1  |              ^^^^^^^^^^^^^^^^^^^^^^^^^^
fastapi-boilerplate-worker-1  |   File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
fastapi-boilerplate-worker-1  |     return _bootstrap._gcd_import(name[level:], package, level)
fastapi-boilerplate-worker-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
fastapi-boilerplate-worker-1  |   File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
fastapi-boilerplate-worker-1  |   File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
fastapi-boilerplate-worker-1  |   File "<frozen importlib._bootstrap>", line 1140, in _find_and_load_unlocked
fastapi-boilerplate-worker-1  | ModuleNotFoundError: No module named 'app.worker'

You need to update the reference in docker-compose.yml as well.

@AlessioBugetti
Copy link
Contributor Author

AlessioBugetti commented Jan 10, 2024

I have updated the reference in docker-compose.yml and in README.md

@igorbenav
Copy link
Owner

@AlessioBugetti nice one, thanks!

@igorbenav igorbenav merged commit e8e6591 into igorbenav:main Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move worker script
2 participants