MCPcopy
hub / github.com/HelloZeroNet/ZeroNet / onUpdated

Method onUpdated

src/Site/SiteStorage.py:307–322  ·  view source on GitHub ↗
(self, inner_path, file=None)

Source from the content-addressed store, hash-verified

305
306 # Site content updated
307 def onUpdated(self, inner_path, file=None):
308 # Update Sql cache
309 if inner_path == "dbschema.json":
310 self.has_db = self.isFile("dbschema.json")
311 # Reopen DB to check changes
312 if self.has_db:
313 self.closeDb()
314 self.getDb()
315 elif not config.disable_db and (inner_path.endswith(".json") or inner_path.endswith(".json.gz")) and self.has_db: # Load json file to db
316 if config.verbose:
317 self.log.debug("Loading json file to db: %s (file: %s)" % (inner_path, file))
318 try:
319 self.updateDbFile(inner_path, file)
320 except Exception as err:
321 self.log.error("Json %s load error: %s" % (inner_path, Debug.formatException(err)))
322 self.closeDb()
323
324 # Load and parse json file
325 def loadJson(self, inner_path):

Callers 5

writeMethod · 0.95
deleteMethod · 0.95
deleteFilesMethod · 0.95
cloneMethod · 0.45
signMethod · 0.45

Calls 5

isFileMethod · 0.95
closeDbMethod · 0.95
getDbMethod · 0.95
updateDbFileMethod · 0.95
errorMethod · 0.80

Tested by

no test coverage detected