FLUSHDB [ASYNC] * * Flushes the currently SELECTed Redis DB. */
| 654 | * |
| 655 | * Flushes the currently SELECTed Redis DB. */ |
| 656 | void flushdbCommand(client *c) { |
| 657 | int flags; |
| 658 | |
| 659 | if (getFlushCommandFlags(c,&flags) == C_ERR) return; |
| 660 | server.dirty += emptyDb(c->db->id,flags,NULL); |
| 661 | addReply(c,shared.ok); |
| 662 | #if defined(USE_JEMALLOC) |
| 663 | /* jemalloc 5 doesn't release pages back to the OS when there's no traffic. |
| 664 | * for large databases, flushdb blocks for long anyway, so a bit more won't |
| 665 | * harm and this way the flush and purge will be synchroneus. */ |
| 666 | if (!(flags & EMPTYDB_ASYNC)) |
| 667 | jemalloc_purge(); |
| 668 | #endif |
| 669 | } |
| 670 | |
| 671 | /* FLUSHALL [ASYNC] |
| 672 | * |
nothing calls this directly
no test coverage detected