Skip to content

Commit 3ab54c3

Browse files
author
Jakob Mellberg
committed
ruff format
1 parent 4b4429e commit 3ab54c3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

kea_exporter/cli.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,18 @@
66
from . import __project__, __version__
77

88

9-
class Timer():
9+
class Timer:
1010
def __init__(self):
1111
self.reset()
12+
1213
def reset(self):
1314
self.start_time = time.time()
15+
1416
def time_elapsed(self):
1517
now_time = time.time()
1618
return now_time - self.start_time
1719

20+
1821
@click.command()
1922
@click.option(
2023
"-m",
@@ -85,12 +88,14 @@ def cli(mode, port, address, interval, **kwargs):
8588

8689
def local_wsgi_app(registry):
8790
func = make_wsgi_app(registry, False)
91+
8892
def app(environ, start_response):
8993
if t.time_elapsed() >= interval:
9094
exporter.update()
9195
t.reset()
9296
output_array = func(environ, start_response)
9397
return output_array
98+
9499
return app
95100

96101
httpd.set_app(local_wsgi_app(REGISTRY))
@@ -100,5 +105,6 @@ def app(environ, start_response):
100105
while True:
101106
time.sleep(1)
102107

108+
103109
if __name__ == "__main__":
104110
cli()

0 commit comments

Comments
 (0)