-
Notifications
You must be signed in to change notification settings - Fork 453
Fix bug when run command celery
#569
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
builds are failing
@@ -17,7 +17,6 @@ class Command(CeleryCommand): | |||
preload_options = base.preload_options if base.preload_options else [] | |||
else: | |||
preload_options = [] | |||
preload_options = base.preload_options if base.preload_options else [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this and the if/else block could be replace with just:
preload_options = getattr(base, 'preload_options', []) or []
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fixed it. Thanks, @liquidpele :).
@auvipy , it's failed looked like some others. I think it should be fixed somewhere but this PR. |
'CeleryCommand' object has no attribute 'preload_options' |
flake8 tests are failing now. |
def _validate_thread_sharing(self): | ||
if (not self.allow_thread_sharing and | ||
self._thread_ident != _get_ident()): | ||
if not self.validate_thread(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you are missing the underscore for the method name you added?
raise DatabaseError( | ||
DB_SHARED_THREAD % ( | ||
self.alias, self._thread_ident, _get_ident()), | ||
) | ||
|
||
BaseDatabaseWrapper.__init__ = _init | ||
BaseDatabaseWrapper.validate_thread = _validate_thread |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@liquidpele , it doesn't have underscore here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I see. Didn't expand to look at the whole file. Thx.
* fix bug when run command `celery` * refactor get preload_options from base * fix failed by flask8 * fix tests * remove redundant * fix typo
There's a bug when run
python manage celery
related to attributepreload_options
not existed inCeleryCommand
.