(self, inner_path, file=None)
| 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): |
no test coverage detected