File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
src/allocation/entrypoints Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change 22import logging
33import redis
44
5- from allocation import config
5+ from allocation import bootstrap , config
66from allocation .domain import commands
7- from allocation .adapters import orm
8- from allocation .service_layer import messagebus , unit_of_work
97
108logger = logging .getLogger (__name__ )
119
1210r = redis .Redis (** config .get_redis_host_and_port ())
1311
1412
1513def main ():
16- orm . start_mappers ()
14+ bus = bootstrap . bootstrap ()
1715 pubsub = r .pubsub (ignore_subscribe_messages = True )
1816 pubsub .subscribe ("change_batch_quantity" )
1917
2018 for m in pubsub .listen ():
21- handle_change_batch_quantity (m )
19+ handle_change_batch_quantity (m , bus )
2220
2321
24- def handle_change_batch_quantity (m ):
22+ def handle_change_batch_quantity (m , bus ):
2523 logging .debug ("handling %s" , m )
2624 data = json .loads (m ["data" ])
2725 cmd = commands .ChangeBatchQuantity (ref = data ["batchref" ], qty = data ["qty" ])
28- messagebus .handle (cmd , uow = unit_of_work . SqlAlchemyUnitOfWork () )
26+ bus .handle (cmd )
2927
3028
3129if __name__ == "__main__" :
You can’t perform that action at this time.
0 commit comments