18 lines
373 B
Python
18 lines
373 B
Python
import traceback
|
|
from common import *
|
|
from settings import settings
|
|
|
|
|
|
def run():
|
|
for topic, msg in consumer():
|
|
try:
|
|
data = flat_data(msg)
|
|
legu_topic = settings.TOPIC_TO_LEGU.get(data['app_id'])
|
|
producer(legu_topic, data)
|
|
except Exception as e:
|
|
traceback.print_exc()
|
|
|
|
|
|
if __name__ == '__main__':
|
|
run()
|