wait for dirty db to be flushed before responding to http request
fix embarrassing "wrong operator used" bug