def retry_after(self): """The amount of time to sleep before retrying :returns: The amount of time in seconds to wait before calling is_processing. """ return utils.int_or_none(self._field_data.headers.get('Retry-After'))
def retry_after(self): """The amount of time to sleep before retrying Deprecated: use sleep_for. This is not working with Retry-After header in date format. :returns: The amount of time in seconds to wait before calling is_processing. """ LOG.warning('TaskMonitor retry_after is deprecated, use sleep_for.') return utils.int_or_none(self._response.headers.get('Retry-After'))
def test_int_or_none(self): self.assertEqual(1, utils.int_or_none('1')) self.assertIsNone(None, utils.int_or_none(None))