diff --git a/internal/helper.go b/internal/helper.go index 2709e7c..a0ba33b 100644 --- a/internal/helper.go +++ b/internal/helper.go @@ -6,6 +6,7 @@ import ( "path/filepath" "github.com/graph-gophers/dataloader" + log "github.com/sirupsen/logrus" ) func invalidateCache(ctx context.Context, id string) error { @@ -14,10 +15,15 @@ func invalidateCache(ctx context.Context, id string) error { return fmt.Errorf("Failed to get loader from context") } + log.Debug("Invalidate cache for id: ", id) + loader["getFile"].Clear(ctx, dataloader.StringKey(id)) - loader["listObjects"].Clear(ctx, dataloader.StringKey(id)) loader["getFiles"].Clear(ctx, dataloader.StringKey(getPathFromId(id))) + // FIXME: this is the only way i can invalidate the cache without it breaking stuff + // loader["listObjects"].Clear(ctx, dataloader.StringKey(id)) + loader["listObjects"].ClearAll() + return nil }