Commit 068db638 authored by Ivan Tyagov's avatar Ivan Tyagov

Read and init values from ERP5 backend.

parent 2d48c8aa
...@@ -84,9 +84,8 @@ async def main(): ...@@ -84,9 +84,8 @@ async def main():
for k,v in erp5_json.items(): for k,v in erp5_json.items():
# set # set
node = server.get_node(k) node = server.get_node(k)
_logger.error("Set %s = %s at %s" %(k, v, node)) _logger.debug("Init from ERP5. Set %s = %s at %s" %(k, v, node))
# XXX: this leads to a change notification which calls ERP5 and endless loop! await node.write_value(v)
#await node.write_value(v)
subscription = await server.create_subscription(1000, erp5_handler) subscription = await server.create_subscription(1000, erp5_handler)
await subscription.subscribe_events() await subscription.subscribe_events()
...@@ -107,7 +106,7 @@ async def main(): ...@@ -107,7 +106,7 @@ async def main():
while True: while True:
await asyncio.sleep(1) await asyncio.sleep(1)
logging.basicConfig(level=logging.ERROR) logging.basicConfig(level=logging.DEBUG)
asyncio.run(main(), debug=True) asyncio.run(main(), debug=True)
if __name__ == '__main__': if __name__ == '__main__':
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment