MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / delGenericCommand

Function delGenericCommand

src/db.cpp:889–905  ·  view source on GitHub ↗

This command implements DEL and LAZYDEL. */

Source from the content-addressed store, hash-verified

887
888/* This command implements DEL and LAZYDEL. */
889void delGenericCommand(client *c, int lazy) {
890 int numdel = 0, j;
891
892 for (j = 1; j < c->argc; j++) {
893 expireIfNeeded(c->db,c->argv[j]);
894 int deleted = lazy ? dbAsyncDelete(c->db,c->argv[j]) :
895 dbSyncDelete(c->db,c->argv[j]);
896 if (deleted) {
897 signalModifiedKey(c,c->db,c->argv[j]);
898 notifyKeyspaceEvent(NOTIFY_GENERIC,
899 "del",c->argv[j],c->db->id);
900 g_pserver->dirty++;
901 numdel++;
902 }
903 }
904 addReplyLongLong(c,numdel);
905}
906
907void delCommand(client *c) {
908 delGenericCommand(c,g_pserver->lazyfree_lazy_user_del);

Callers 2

delCommandFunction · 0.85
unlinkCommandFunction · 0.85

Calls 6

expireIfNeededFunction · 0.85
dbAsyncDeleteFunction · 0.85
dbSyncDeleteFunction · 0.85
signalModifiedKeyFunction · 0.85
notifyKeyspaceEventFunction · 0.85
addReplyLongLongFunction · 0.85

Tested by

no test coverage detected