MCPcopy Create free account
hub / github.com/F-Stack/f-stack / RM_ResetDataset

Function RM_ResetDataset

app/redis-6.2.6/src/module.c:2424–2428  ·  view source on GitHub ↗

Performs similar operation to FLUSHALL, and optionally start a new AOF file (if enabled) * If restart_aof is true, you must make sure the command that triggered this call is not * propagated to the AOF file. * When async is set to true, db contents will be freed by a background thread. */

Source from the content-addressed store, hash-verified

2422 * propagated to the AOF file.
2423 * When async is set to true, db contents will be freed by a background thread. */
2424void RM_ResetDataset(int restart_aof, int async) {
2425 if (restart_aof && server.aof_state != AOF_OFF) stopAppendOnly();
2426 flushAllDataAndResetRDB(async? EMPTYDB_ASYNC: EMPTYDB_NO_FLAGS);
2427 if (server.aof_enabled && restart_aof) restartAOFAfterSYNC();
2428}
2429
2430/* Returns the number of keys in the current db. */
2431unsigned long long RM_DbSize(RedisModuleCtx *ctx) {

Callers

nothing calls this directly

Calls 3

stopAppendOnlyFunction · 0.85
flushAllDataAndResetRDBFunction · 0.85
restartAOFAfterSYNCFunction · 0.85

Tested by

no test coverage detected