forked from indymedia/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
|
||||
|
||||
# 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'
|
||||
if not os.path.isfile(cacheFilename):
|
||||
with open(cacheFilename, 'w') as fp:
|
||||
|
|
|
@ -2934,6 +2934,12 @@ def runDaemon(projectVersion, \
|
|||
print('Creating shared inbox: inbox@'+domain)
|
||||
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')
|
||||
httpd.thrInboxQueue= \
|
||||
threadWithTrace(target=runInboxQueue, \
|
||||
|
|
15
epicyon.py
15
epicyon.py
|
@ -287,6 +287,11 @@ httpPrefix='https'
|
|||
if args.http:
|
||||
httpPrefix='http'
|
||||
|
||||
baseDir=args.baseDir
|
||||
if baseDir.endswith('/'):
|
||||
print("--path option should not end with '/'")
|
||||
sys.exit()
|
||||
|
||||
if args.posts:
|
||||
if '@' not in args.posts:
|
||||
print('Syntax: --posts nickname@domain')
|
||||
|
@ -313,10 +318,12 @@ if args.postsraw:
|
|||
__version__)
|
||||
sys.exit()
|
||||
|
||||
baseDir=args.baseDir
|
||||
if baseDir.endswith('/'):
|
||||
print("--path option should not end with '/'")
|
||||
sys.exit()
|
||||
# create cache for actors
|
||||
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')
|
||||
|
||||
if args.domain:
|
||||
domain=args.domain
|
||||
|
|
Loading…
Reference in New Issue