InitLibraryCacheInvalidator wires the model-level library cache invalidation hook.
()
| 17 | |
| 18 | // InitLibraryCacheInvalidator wires the model-level library cache invalidation hook. |
| 19 | func InitLibraryCacheInvalidator() { |
| 20 | librarySnapshotCacheInvalidatorOnce.Do(func() { |
| 21 | model.SetLibraryCacheInvalidator(invalidateLibrarySnapshotCache) |
| 22 | model.SetLibraryCacheLoader(loadLibrariesSnapshotWithCache) |
| 23 | }) |
| 24 | } |
| 25 | |
| 26 | func loadLibrariesSnapshotWithCache(eid int64) ([]model.Library, error) { |
| 27 | if eid <= 0 { |