Store actor in cache

master
Bob Mottram 2019-08-22 16:14:05 +01:00
parent cbb8df7431
commit 443b73223e
1 changed files with 2 additions and 1 deletions

View File

@ -111,6 +111,7 @@ from announce import createAnnounce
from announce import outboxAnnounce from announce import outboxAnnounce
from content import addHtmlTags from content import addHtmlTags
from media import removeMetaData from media import removeMetaData
from cache import storePersonInCache
import os import os
import sys import sys
@ -2260,7 +2261,7 @@ class PubServer(BaseHTTPRequestHandler):
with open(actorFilename, 'w') as fp: with open(actorFilename, 'w') as fp:
commentjson.dump(actorJson, fp, indent=4, sort_keys=False) commentjson.dump(actorJson, fp, indent=4, sort_keys=False)
# also copy to the actors cache and personCache in memory # also copy to the actors cache and personCache in memory
self.server.personCache[actorJson['id']]=actorJson storePersonInCache(self.server.baseDir,actorJson['id'],actorJson,self.server.personCache)
actorCacheFilename=self.server.baseDir+'/cache/actors/'+actorJson['id'].replace('/','#')+'.json' actorCacheFilename=self.server.baseDir+'/cache/actors/'+actorJson['id'].replace('/','#')+'.json'
with open(actorCacheFilename, 'w') as fp: with open(actorCacheFilename, 'w') as fp:
commentjson.dump(actorJson, fp, indent=4, sort_keys=False) commentjson.dump(actorJson, fp, indent=4, sort_keys=False)