Cosmetic change
This commit is contained in:
@@ -10,16 +10,19 @@ TARGETS = [
|
|||||||
'name': 'Gitea',
|
'name': 'Gitea',
|
||||||
'url': 'https://gitea.rainbow-herring.ts.net/api/healthz',
|
'url': 'https://gitea.rainbow-herring.ts.net/api/healthz',
|
||||||
'kind': 'gitea',
|
'kind': 'gitea',
|
||||||
|
'critical': True,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'name': 'Packs Site (Production)',
|
'name': 'Packs Site (Production)',
|
||||||
'url': 'https://jakerasp.rainbow-herring.ts.net/healthz/',
|
'url': 'https://jakerasp.rainbow-herring.ts.net/healthz/',
|
||||||
'kind': 'packs',
|
'kind': 'packs',
|
||||||
|
'critical': True,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
'name': 'Packs Site (Development)',
|
'name': 'Packs Site (Development)',
|
||||||
'url': 'https://jakepc.rainbow-herring.ts.net/healthz/',
|
'url': 'https://jakepc.rainbow-herring.ts.net/healthz/',
|
||||||
'kind': 'packs',
|
'kind': 'packs',
|
||||||
|
'critical': False,
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -80,6 +83,7 @@ async def check_target(session, target, timeout):
|
|||||||
'name': target['name'],
|
'name': target['name'],
|
||||||
'kind': target.get('kind', ''),
|
'kind': target.get('kind', ''),
|
||||||
'url': target['url'],
|
'url': target['url'],
|
||||||
|
'critical': target.get('critical', True),
|
||||||
'up': False,
|
'up': False,
|
||||||
'status_code': None,
|
'status_code': None,
|
||||||
'latency_ms': None,
|
'latency_ms': None,
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ class HealthBot(discord.Client):
|
|||||||
return await checks.run_checks(session, config.CHECK_TIMEOUT)
|
return await checks.run_checks(session, config.CHECK_TIMEOUT)
|
||||||
|
|
||||||
def build_embed(self, results):
|
def build_embed(self, results):
|
||||||
all_up = all(r['up'] for r in results)
|
all_up = all(r['up'] for r in results if r.get('critical', True))
|
||||||
color = discord.Color.green() if all_up else discord.Color.red()
|
color = discord.Color.green() if all_up else discord.Color.red()
|
||||||
embed = discord.Embed(
|
embed = discord.Embed(
|
||||||
title='Service Health',
|
title='Service Health',
|
||||||
|
|||||||
Reference in New Issue
Block a user