(self, key, timeout=None, backoff=1.15, max_delay=1.0)
| 572 | return EmptyData if not exists else val |
| 573 | |
| 574 | def wait_result(self, key, timeout=None, backoff=1.15, max_delay=1.0): |
| 575 | if not self.notify_result: |
| 576 | return super(RedisStorage, self).wait_result(key, timeout, |
| 577 | backoff, max_delay) |
| 578 | |
| 579 | if self.has_data_for_key(key): |
| 580 | return True |
| 581 | nkey = self.notify_prefix + key |
| 582 | timeout = timeout or 0 |
| 583 | if timeout > 0 and self.redis_version[0] < 6: |
| 584 | timeout = max(1, int(timeout)) # Timeout must be int for R < 6. |
| 585 | try: |
| 586 | result = self.conn.blpop(nkey, timeout=timeout) |
| 587 | except (ConnectionError, TimeoutError): |
| 588 | return False |
| 589 | |
| 590 | if result is not None: |
| 591 | self.conn.delete(nkey) |
| 592 | return True |
| 593 | |
| 594 | return False |
| 595 | |
| 596 | def has_data_for_key(self, key): |
| 597 | return self.conn.hexists(self.result_key, key) |
nothing calls this directly
no test coverage detected