I think this should be:

```
flush_cutoff_time = cur_time - (cur_time % interval)
if bucket_timestmap < flush_cutoff_time:
      ...
```

Because I think without that check it can flush incomplete buckets.