eantyshev commented on code in PR #24056:
URL: https://github.com/apache/beam/pull/24056#discussion_r1019411755


##########
playground/backend/internal/db/datastore/datastore_db.go:
##########
@@ -429,39 +427,52 @@ func (d *Datastore) GetExampleGraph(ctx context.Context, 
id string) (string, err
        return pcObj.Content, nil
 }
 
-//DeleteUnusedSnippets deletes all unused snippets
-func (d *Datastore) DeleteUnusedSnippets(ctx context.Context, dayDiff int32) 
error {
-       var hoursDiff = dayDiff * 24
-       boundaryDate := time.Now().Add(-time.Hour * time.Duration(hoursDiff))
-       snippetQuery := datastore.NewQuery(constants.SnippetKind).
-               Namespace(utils.GetNamespace(ctx)).
-               Filter("lVisited <= ", boundaryDate).
-               Filter("origin =", constants.UserSnippetOrigin).
+func (d *Datastore) deleteSnippets(ctx context.Context, snippetQuery 
*datastore.Query,
+       postQueryFilter func(*datastore.Key) bool) error {

Review Comment:
   Good point, thanks! I pushed it even further, since we need only one 
`skipKey`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to