Search code examples
expresssessionredisexpress-session

Redis monitor command shows the same requests every second


I just set up a Redis client with an Express server so that I can persist user session data in the Redis store. For interest sake, I am monitoring my requests on the cli using the monitor command to see what requests are made through Express. When a user logs in I set a userId key on the req.session object, and the request shows up on the cli:

"set" "sess:2w8OkICwucsO9-18z_ghxA1FLH9GcWpx" "{\"cookie\":{\"originalMaxAge\":3600000,\"expires\":\"2020-10-09T12:09:37.604Z\",\"secure\":false,\"httpOnly\":true,\"path\":\"/\"}}" "EX" "3600"

But after storing the session information, the get and expire commands are shown to be logged on the cli:

1602241780.017805 [0 127.0.0.1:61201] "get" "sess:2w8OkICwucsO9-18z_ghxA1FLH9GcWpx"
1602241780.026601 [0 127.0.0.1:61201] "expire" "sess:2w8OkICwucsO9-18z_ghxA1FLH9GcWpx" "3600"
1602241783.014473 [0 127.0.0.1:61201] "get" "sess:2w8OkICwucsO9-18z_ghxA1FLH9GcWpx"
1602241783.020260 [0 127.0.0.1:61201] "expire" "sess:2w8OkICwucsO9-18z_ghxA1FLH9GcWpx" "3600"
1602241786.018502 [0 127.0.0.1:61201] "get" "sess:2w8OkICwucsO9-18z_ghxA1FLH9GcWpx"
1602241786.024512 [0 127.0.0.1:61201] "expire" "sess:2w8OkICwucsO9-18z_ghxA1FLH9GcWpx" "3600"
1602241789.018028 [0 127.0.0.1:61201] "get" "sess:2w8OkICwucsO9-18z_ghxA1FLH9GcWpx"
1602241789.023479 [0 127.0.0.1:61201] "expire" "sess:2w8OkICwucsO9-18z_ghxA1FLH9GcWpx" "3600"

And this continues like this every second..

I am pretty sure that I am not constantly calling any functions through Express, so why does the monitor command show these requests?


Solution

  • The problem was GraphQL Playground that performs an introspection query every 2 seconds. I disabled the setting in the settings tab and it worked!