FLUSHALL [ASYNC] * * Flushes the whole server data set. */
| 862 | * |
| 863 | * Flushes the whole server data set. */ |
| 864 | void flushallCommand(client *c) { |
| 865 | int flags; |
| 866 | |
| 867 | if (c->argc == 2) |
| 868 | { |
| 869 | if (!strcasecmp(szFromObj(c->argv[1]), "cache")) |
| 870 | { |
| 871 | if (g_pserver->m_pstorageFactory == nullptr) |
| 872 | { |
| 873 | addReplyError(c, "Cannot flush cache without a storage provider set"); |
| 874 | return; |
| 875 | } |
| 876 | for (int idb = 0; idb < cserver.dbnum; ++idb) |
| 877 | g_pserver->db[idb]->removeAllCachedValues(); |
| 878 | addReply(c,shared.ok); |
| 879 | return; |
| 880 | } |
| 881 | } |
| 882 | |
| 883 | if (getFlushCommandFlags(c,&flags) == C_ERR) return; |
| 884 | flushAllDataAndResetRDB(flags); |
| 885 | addReply(c,shared.ok); |
| 886 | } |
| 887 | |
| 888 | /* This command implements DEL and LAZYDEL. */ |
| 889 | void delGenericCommand(client *c, int lazy) { |
nothing calls this directly
no test coverage detected