forked from BasedHardware/omi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjob.py
More file actions
28 lines (19 loc) · 764 Bytes
/
Copy pathjob.py
File metadata and controls
28 lines (19 loc) · 764 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import asyncio
import json
import logging
import os
import firebase_admin
from utils.other.jobs import start_job
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
def main() -> None:
if os.environ.get('SERVICE_ACCOUNT_JSON'):
service_account_info = json.loads(os.environ["SERVICE_ACCOUNT_JSON"])
credentials = firebase_admin.credentials.Certificate(service_account_info)
firebase_admin.initialize_app(credentials) # type: ignore[reportUnknownMemberType] # firebase_admin untyped
else:
firebase_admin.initialize_app() # type: ignore[reportUnknownMemberType] # firebase_admin untyped
logger.info('Starting job...')
asyncio.run(start_job())
if __name__ == '__main__':
main()