Core outline
This commit is contained in:
parent
eeada83132
commit
2d3699ad00
7 changed files with 47 additions and 0 deletions
0
app/core/__init__.py
Normal file
0
app/core/__init__.py
Normal file
28
app/core/core.py
Normal file
28
app/core/core.py
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
from app.model.healthcheck import HealthCheck
|
||||
from app.services import DockerService, GitService, Passwords
|
||||
|
||||
|
||||
class WebhookProcessor:
|
||||
def __init__(self):
|
||||
try:
|
||||
self._docker = DockerService()
|
||||
except Exception as e:
|
||||
self._docker = None
|
||||
print(e)
|
||||
try:
|
||||
self._git = GitService()
|
||||
except Exception as e:
|
||||
self._git = None
|
||||
print(f"{type(e).__name__}: {e}")
|
||||
try:
|
||||
self._keepass = Passwords()
|
||||
except Exception as e:
|
||||
self._keepass = None
|
||||
print(e)
|
||||
|
||||
@property
|
||||
def health(self) -> HealthCheck:
|
||||
return HealthCheck(
|
||||
self._docker is not None and self._git is not None and self._keepass is not None,
|
||||
f"Docker: {self._docker is not None}, Git: {self._git is not None}, KeePass: {self._keepass is not None}"
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue