feat: unread mail counter
This commit is contained in:
parent
d4496a2eda
commit
cdbb47f6b9
5 changed files with 54 additions and 7 deletions
6
main.py
6
main.py
|
@ -4,7 +4,7 @@ import time
|
|||
from prometheus_client import start_http_server
|
||||
from dotenv import load_dotenv
|
||||
|
||||
load_dotenv()
|
||||
load_dotenv('.env', verbose=True)
|
||||
|
||||
def load_stat_modules(path='stats'):
|
||||
modules = []
|
||||
|
@ -23,10 +23,10 @@ def load_stat_modules(path='stats'):
|
|||
|
||||
if __name__ == '__main__':
|
||||
port = int(os.getenv("EXPORTER_PORT", "8000"))
|
||||
modules = load_stat_modules()
|
||||
print(f"Starting exporter on port {port}...")
|
||||
start_http_server(port)
|
||||
|
||||
modules = load_stat_modules()
|
||||
|
||||
while True:
|
||||
for mod in modules:
|
||||
|
@ -34,4 +34,4 @@ if __name__ == '__main__':
|
|||
mod.update()
|
||||
except Exception as e:
|
||||
print(f"Error in {mod.__name__}: {e}")
|
||||
time.sleep(int(os.getenv("SCRAPE_INTERVAL", "30")))
|
||||
time.sleep(int(os.getenv("UPDATE_INTERVAL", "30")))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue