Merge remote-tracking branch 'origin/master' into lash/transfer-authorization
This commit is contained in:
@@ -445,8 +445,9 @@ class Api:
|
||||
],
|
||||
queue=self.queue,
|
||||
)
|
||||
s_local.link(s_brief)
|
||||
if self.callback_param != None:
|
||||
s_assemble.link(self.callback_success).on_error(self.callback_error)
|
||||
s_brief.link(self.callback_success).on_error(self.callback_error)
|
||||
|
||||
t = None
|
||||
if external_task != None:
|
||||
@@ -471,11 +472,10 @@ class Api:
|
||||
c = celery.chain(s_external_get, s_external_process)
|
||||
t = celery.chord([s_local, c])(s_brief)
|
||||
else:
|
||||
t = s_local.apply_sync()
|
||||
t = s_local.apply_async(queue=self.queue)
|
||||
|
||||
return t
|
||||
|
||||
|
||||
def ping(self, r):
|
||||
"""A noop callback ping for testing purposes.
|
||||
|
||||
|
||||
@@ -149,6 +149,9 @@ def tx_collate(tx_batches, chain_str, offset, limit, newest_first=True):
|
||||
txs_by_block = {}
|
||||
chain_spec = ChainSpec.from_chain_str(chain_str)
|
||||
|
||||
if isinstance(tx_batches, dict):
|
||||
tx_batches = [tx_batches]
|
||||
|
||||
for b in tx_batches:
|
||||
for v in b.values():
|
||||
tx = None
|
||||
|
||||
@@ -39,6 +39,7 @@ from cic_eth.callbacks import redis
|
||||
from cic_eth.db.models.base import SessionBase
|
||||
from cic_eth.db.models.otx import Otx
|
||||
from cic_eth.db import dsn_from_config
|
||||
from cic_eth.ext import tx
|
||||
|
||||
logging.basicConfig(level=logging.WARNING)
|
||||
logg = logging.getLogger()
|
||||
|
||||
29
apps/cic-eth/tests/tasks/test_debug.py
Normal file
29
apps/cic-eth/tests/tasks/test_debug.py
Normal file
@@ -0,0 +1,29 @@
|
||||
# external imports
|
||||
import celery
|
||||
|
||||
# local imports
|
||||
from cic_eth.db.models.debug import Debug
|
||||
|
||||
|
||||
def test_debug_alert(
|
||||
init_database,
|
||||
celery_session_worker,
|
||||
):
|
||||
|
||||
s = celery.signature(
|
||||
'cic_eth.admin.debug.alert',
|
||||
[
|
||||
'foo',
|
||||
'bar',
|
||||
'baz',
|
||||
],
|
||||
queue=None,
|
||||
)
|
||||
t = s.apply_async()
|
||||
r = t.get()
|
||||
assert r == 'foo'
|
||||
|
||||
q = init_database.query(Debug)
|
||||
q = q.filter(Debug.tag=='bar')
|
||||
o = q.first()
|
||||
assert o.description == 'baz'
|
||||
Reference in New Issue
Block a user