When profile details are changed update the actor cache and cache in memory

master
Bob Mottram 2019-08-22 15:50:47 +01:00
parent 7be05617eb
commit cbb8df7431
1 changed files with 5 additions and 0 deletions

View File

@ -2259,6 +2259,11 @@ class PubServer(BaseHTTPRequestHandler):
if actorChanged:
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
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)
# send actor update to followers
updateActorJson={
'type': 'Update',