Added DeprecationWarning to worker.state.

This commit is contained in:
Selwin Ong 2014-03-06 09:44:44 +07:00
parent 2fe5d9e25e
commit 72457d2286
1 changed files with 4 additions and 0 deletions

View File

@ -220,6 +220,10 @@ class Worker(object):
connection.hset(self.key, 'state', 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)
def get_state(self):