mirror of https://gitlab.com/bashrc2/epicyon
Create actor cache when daemon starts
parent
9b39bfee94
commit
97799f1db2
4
cache.py
4
cache.py
|
@ -22,10 +22,6 @@ def storePersonInCache(baseDir: str,personUrl: str,personJson: {},personCache: {
|
||||||
return
|
return
|
||||||
|
|
||||||
# store to file
|
# store to file
|
||||||
if not os.path.isdir(baseDir+'/cache'):
|
|
||||||
os.mkdir(baseDir+'/cache')
|
|
||||||
if not os.path.isdir(baseDir+'/cache/actors'):
|
|
||||||
os.mkdir(baseDir+'/cache/actors')
|
|
||||||
cacheFilename=baseDir+'/cache/actors/'+personUrl.replace('/','#')+'.json'
|
cacheFilename=baseDir+'/cache/actors/'+personUrl.replace('/','#')+'.json'
|
||||||
if not os.path.isfile(cacheFilename):
|
if not os.path.isfile(cacheFilename):
|
||||||
with open(cacheFilename, 'w') as fp:
|
with open(cacheFilename, 'w') as fp:
|
||||||
|
|
|
@ -2934,6 +2934,12 @@ def runDaemon(projectVersion, \
|
||||||
print('Creating shared inbox: inbox@'+domain)
|
print('Creating shared inbox: inbox@'+domain)
|
||||||
createSharedInbox(baseDir,'inbox',domain,port,httpPrefix)
|
createSharedInbox(baseDir,'inbox',domain,port,httpPrefix)
|
||||||
|
|
||||||
|
if not os.path.isdir(baseDir+'/cache'):
|
||||||
|
os.mkdir(baseDir+'/cache')
|
||||||
|
if not os.path.isdir(baseDir+'/cache/actors'):
|
||||||
|
print('Creating actors cache')
|
||||||
|
os.mkdir(baseDir+'/cache/actors')
|
||||||
|
|
||||||
print('Creating inbox queue')
|
print('Creating inbox queue')
|
||||||
httpd.thrInboxQueue= \
|
httpd.thrInboxQueue= \
|
||||||
threadWithTrace(target=runInboxQueue, \
|
threadWithTrace(target=runInboxQueue, \
|
||||||
|
|
15
epicyon.py
15
epicyon.py
|
@ -287,6 +287,11 @@ httpPrefix='https'
|
||||||
if args.http:
|
if args.http:
|
||||||
httpPrefix='http'
|
httpPrefix='http'
|
||||||
|
|
||||||
|
baseDir=args.baseDir
|
||||||
|
if baseDir.endswith('/'):
|
||||||
|
print("--path option should not end with '/'")
|
||||||
|
sys.exit()
|
||||||
|
|
||||||
if args.posts:
|
if args.posts:
|
||||||
if '@' not in args.posts:
|
if '@' not in args.posts:
|
||||||
print('Syntax: --posts nickname@domain')
|
print('Syntax: --posts nickname@domain')
|
||||||
|
@ -313,10 +318,12 @@ if args.postsraw:
|
||||||
__version__)
|
__version__)
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
baseDir=args.baseDir
|
# create cache for actors
|
||||||
if baseDir.endswith('/'):
|
if not os.path.isdir(baseDir+'/cache'):
|
||||||
print("--path option should not end with '/'")
|
os.mkdir(baseDir+'/cache')
|
||||||
sys.exit()
|
if not os.path.isdir(baseDir+'/cache/actors'):
|
||||||
|
print('Creating actors cache')
|
||||||
|
os.mkdir(baseDir+'/cache/actors')
|
||||||
|
|
||||||
if args.domain:
|
if args.domain:
|
||||||
domain=args.domain
|
domain=args.domain
|
||||||
|
|
Loading…
Reference in New Issue