-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
63 lines (42 loc) · 1 KB
/
main.py
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#TODO: change secret
#env vars:
#FIREBASE_CONFIG
#{
# "databaseURL":
# "https://databaseName.firebaseio.com"
#}
#GOOGLE_APPLICATION_CREDENTIALS
#from console.firebase.google.com
from utils.timing import timepoint
timepoint('imports:')
#from utils.task import sync_ensure
#from utils.task import addtask
import asyncio
timepoint('importing database:')
import firebase
timepoint('starting:')
from firebase.cache import printdebug
#import database.cache as cache
import gc
async def main():
timepoint('init database')
root=firebase.init()
timepoint('running test')
root<<{'db':{'testvar':'hello'}}
await asyncio.sleep(1)
root['db']['testvar2']<<'hello2'
await printdebug()
#print(await root())
#print(test())
#root['cde']['test2']['hello']<<'haha'
#print(test())
#print(test['test']())
#print(test['test2']())
#await asyncio.sleep(1)
#await printdebug()
await asyncio.sleep(1)
#test=None
await printdebug()
loop=asyncio.get_event_loop()
loop.run_until_complete(main())
timepoint('end:')