Skip to content

compress_data: warn when quiet_start == quiet_end (silently disables compression) #47

@pbitzer

Description

@pbitzer

Problem

Setting quiet_start and quiet_end to the same value (e.g., both 0) results in compression never running, because _is_quiet_time() evaluates an empty range:

if self.quiet_start <= self.quiet_end:
    return self.quiet_start <= current_hour < self.quiet_end

0 <= current_hour < 0 is always False.

This is logically correct (zero-length window = no window), but it's a silent failure that's easy to hit when trying to configure "always on" compression.

Proposed fix

  • Add a warning log at startup if quiet_start == quiet_end, since this effectively disables compression
  • Document that quiet_start=0, quiet_end=24 is how to enable 24/7 compression

Context

Hit this in production on mj41 and mj43 (HAM-82). Compression was accidentally disabled for ~24 hours.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions