Skip to content

Commit

Permalink
added delete paths
Browse files Browse the repository at this point in the history
  • Loading branch information
harshil-goel committed Oct 7, 2024
1 parent dd46d4c commit 88b912c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion edgraph/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -1411,7 +1411,7 @@ func (s *Server) doQuery(ctx context.Context, req *Request) (resp *api.Response,
EncodingNs: uint64(l.Json.Nanoseconds()),
TotalNs: uint64((time.Since(l.Start)).Nanoseconds()),
}
fmt.Println("====Query Resp", qc.req.Query, qc.req.StartTs, qc.req, string(resp.Json))
//fmt.Println("====Query Resp", qc.req.Query, qc.req.StartTs, qc.req, string(resp.Json))
return resp, gqlErrs
}

Expand Down
20 changes: 10 additions & 10 deletions posting/mvcc.go
Original file line number Diff line number Diff line change
Expand Up @@ -436,16 +436,16 @@ func (sm *shardedMap) deleteOldItems(ts uint64) {
defer func() {
fmt.Println("Done deleting old items")
}()
//for i := 0; i < numShards; i++ {
// sm.shards[i].Lock()
// defer sm.shards[i].Unlock()

// for keyHash, pl := range sm.shards[i].data {
// if pl.lastUpdate < ts-100 {
// delete(sm.shards[i].data, keyHash)
// }
// }
//}
for i := 0; i < numShards; i++ {
sm.shards[i].Lock()
defer sm.shards[i].Unlock()

for keyHash, pl := range sm.shards[i].data {
if pl.lastUpdate < ts-100 {
delete(sm.shards[i].data, keyHash)
}
}
}
}

type lockedMap struct {
Expand Down

0 comments on commit 88b912c

Please sign in to comment.