mirror of https://github.com/nicolargo/glances.git
Lint and format the code
This commit is contained in:
parent
7160cd8ae4
commit
91279b9144
|
|
@ -156,10 +156,7 @@ class GlancesExportAsyncio(GlancesExport):
|
||||||
|
|
||||||
# Submit the export operation to the background event loop
|
# Submit the export operation to the background event loop
|
||||||
try:
|
try:
|
||||||
future = asyncio.run_coroutine_threadsafe(
|
future = asyncio.run_coroutine_threadsafe(self._async_export(name, columns, points), self.loop)
|
||||||
self._async_export(name, columns, points),
|
|
||||||
self.loop
|
|
||||||
)
|
|
||||||
# Don't block forever - use a short timeout
|
# Don't block forever - use a short timeout
|
||||||
future.result(timeout=1)
|
future.result(timeout=1)
|
||||||
except asyncio.TimeoutError:
|
except asyncio.TimeoutError:
|
||||||
|
|
|
||||||
|
|
@ -130,4 +130,5 @@ class Export(GlancesExportAsyncio):
|
||||||
logger.error(f"NATS Unexpected error publishing {subject_name}: {e}", exc_info=True)
|
logger.error(f"NATS Unexpected error publishing {subject_name}: {e}", exc_info=True)
|
||||||
raise
|
raise
|
||||||
|
|
||||||
|
|
||||||
# End of glances/exports/glances_nats/__init__.py
|
# End of glances/exports/glances_nats/__init__.py
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ async def main():
|
||||||
await nc.publish("glances.test", b'A test')
|
await nc.publish("glances.test", b'A test')
|
||||||
await nc.flush()
|
await nc.flush()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
asyncio.run(main())
|
asyncio.run(main())
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ async def main():
|
||||||
|
|
||||||
await nc.close()
|
await nc.close()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
asyncio.run(main())
|
asyncio.run(main())
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue