summaryrefslogtreecommitdiff
path: root/src/blocked.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/blocked.c')
-rw-r--r--src/blocked.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/blocked.c b/src/blocked.c
index 09e17213c..2009c9a24 100644
--- a/src/blocked.c
+++ b/src/blocked.c
@@ -106,12 +106,20 @@ void blockClient(client *c, int btype) {
void updateStatsOnUnblock(client *c, long blocked_us, long reply_us){
const ustime_t total_cmd_duration = c->duration + blocked_us + reply_us;
c->lastcmd->microseconds += total_cmd_duration;
+
/* Log the command into the Slow log if needed. */
- if (!(c->lastcmd->flags & CMD_SKIP_SLOWLOG)) {
+ if (!(c->lastcmd->flags & CMD_SKIP_SLOWLOG) &&
+ !(c->flags & CLIENT_PREVENT_LOGGING))
+ {
slowlogPushEntryIfNeeded(c,c->argv,c->argc,total_cmd_duration);
/* Log the reply duration event. */
latencyAddSampleIfNeeded("command-unblocking",reply_us/1000);
}
+
+ /* Always clear the prevent logging field now. */
+ if (c->flags & CLIENT_PREVENT_LOGGING) {
+ c->flags &= ~CLIENT_PREVENT_LOGGING;
+ }
}
/* This function is called in the beforeSleep() function of the event loop