Merge pull request #2915 from MathiusD/RefreshChannelsJob-frenquency

Allow configuration of the time between 2 RefreshChannelsJob
This commit is contained in:
Samantaz Fox
2022-02-25 00:04:48 +01:00
committed by GitHub
5 changed files with 98 additions and 29 deletions

View File

@@ -257,4 +257,18 @@ struct Preferences
cookies
end
end
module TimeSpanConverter
def self.to_yaml(value : Time::Span, yaml : YAML::Nodes::Builder)
return yaml.scalar value.total_minutes.to_i32
end
def self.from_yaml(ctx : YAML::ParseContext, node : YAML::Nodes::Node) : Time::Span
if node.is_a?(YAML::Nodes::Scalar)
return decode_interval(node.value)
else
node.raise "Expected scalar, not #{node.class}"
end
end
end
end