mirror of https://github.com/rq/rq.git
Added DeprecationWarning to worker.state.
This commit is contained in:
parent
2fe5d9e25e
commit
72457d2286
|
@ -220,6 +220,10 @@ class Worker(object):
|
||||||
connection.hset(self.key, 'state', state)
|
connection.hset(self.key, 'state', state)
|
||||||
|
|
||||||
def _set_state(self, state):
|
def _set_state(self, state):
|
||||||
|
"""Raise a DeprecationWarning if ``worker.state = X`` is used"""
|
||||||
|
raise DeprecationWarning(
|
||||||
|
"worker.state is deprecated, use worker.set_state() instead."
|
||||||
|
)
|
||||||
self.set_state(state)
|
self.set_state(state)
|
||||||
|
|
||||||
def get_state(self):
|
def get_state(self):
|
||||||
|
|
Loading…
Reference in New Issue