diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2017-12-03 12:02:11 +0100 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2017-12-03 12:05:23 +0100 |
commit | 0464c25f602dc2e4d147ca2ac714d49bf96ddcf2 (patch) | |
tree | 3c55fc88891b4bde955713abde3dafa9c95b67dd /app/models/ci/job_artifact.rb | |
parent | 0e1821973da36d995cf1f9673300c59af8c82294 (diff) | |
download | gitlab-ce-0464c25f602dc2e4d147ca2ac714d49bf96ddcf2.tar.gz |
Store expire_at in ci_job_artifacts
Diffstat (limited to 'app/models/ci/job_artifact.rb')
-rw-r--r-- | app/models/ci/job_artifact.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/app/models/ci/job_artifact.rb b/app/models/ci/job_artifact.rb index e02fa021409..84fc6863567 100644 --- a/app/models/ci/job_artifact.rb +++ b/app/models/ci/job_artifact.rb @@ -21,5 +21,16 @@ module Ci def set_size self.size = file.size end + + def expire_in + expire_at - Time.now if expire_at + end + + def expire_in=(value) + self.expire_at = + if value + ChronicDuration.parse(value)&.seconds&.from_now + end + end end end |