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 content import addHtmlTags
from media import removeMetaData
from cache import storePersonInCache
import os
import sys
@ -2260,7 +2261,7 @@ class PubServer(BaseHTTPRequestHandler):
with open(actorFilename, 'w') as fp:
commentjson.dump(actorJson, fp, indent=4, sort_keys=False)
# 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'
with open(actorCacheFilename, 'w') as fp:
commentjson.dump(actorJson, fp, indent=4, sort_keys=False)