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
|
||||
try:
|
||||
future = asyncio.run_coroutine_threadsafe(
|
||||
self._async_export(name, columns, points),
|
||||
self.loop
|
||||
)
|
||||
future = asyncio.run_coroutine_threadsafe(self._async_export(name, columns, points), self.loop)
|
||||
# Don't block forever - use a short timeout
|
||||
future.result(timeout=1)
|
||||
except asyncio.TimeoutError:
|
||||
|
|
|
|||
|
|
@ -130,4 +130,5 @@ class Export(GlancesExportAsyncio):
|
|||
logger.error(f"NATS Unexpected error publishing {subject_name}: {e}", exc_info=True)
|
||||
raise
|
||||
|
||||
|
||||
# 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.flush()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
asyncio.run(main())
|
||||
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ async def main():
|
|||
|
||||
await nc.close()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
asyncio.run(main())
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue