Commit ee7c5539 authored by Kamil Trzcinski's avatar Kamil Trzcinski Committed by Phil Hughes

Add artifacts_expire_in method for Ci::Build

parent 4e9e4e22
...@@ -355,6 +355,18 @@ module Ci ...@@ -355,6 +355,18 @@ module Ci
!artifacts? && artifacts_expire_at && artifacts_expire_at < Time.now !artifacts? && artifacts_expire_at && artifacts_expire_at < Time.now
end end
def artifacts_expire_in
artifacts_expire_at - Time.now if artifacts_expire_at
end
def artifacts_expire_in=(value)
if value
self.artifacts_expire_at = Time.now + ChronicDuration.parse(value)
else
self.artifacts_expire_at = nil
end
end
def keep_artifacts! def keep_artifacts!
self.update(artifacts_expire_at: nil) self.update(artifacts_expire_at: nil)
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment