From 9c42a0bf19ba7d3b28f6d1316956500f50c623e8 Mon Sep 17 00:00:00 2001 From: victor Date: Mon, 17 Aug 2020 12:15:24 +1200 Subject: [PATCH] Added the ttl for job entitytype in tag table --- common/config/config.go | 1 + common/db/tag_store/dynamo.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/common/config/config.go b/common/config/config.go index 40a3cefdd..c99a25836 100644 --- a/common/config/config.go +++ b/common/config/config.go @@ -74,6 +74,7 @@ const ( const ( TASK_TAG_TTL = 6 DEPLOY_JOB_TAG_TTL = 6 + JOB_TAG_TTL = 6 ) var RequiredAPIVariables = []string{ diff --git a/common/db/tag_store/dynamo.go b/common/db/tag_store/dynamo.go index 87b6964ad..a88cae4f1 100644 --- a/common/db/tag_store/dynamo.go +++ b/common/db/tag_store/dynamo.go @@ -116,6 +116,8 @@ func (d *DynamoTagStore) Insert(tag models.Tag) error { //Add TTL value if tag.EntityType == "task" { d.addTTLValue(tag, config.TASK_TAG_TTL) + } else if tag.EntityType == "job" { + d.addTTLValue(tag, config.JOB_TAG_TTL) } else if tag.EntityType == "deploy" && strings.HasPrefix(tag.EntityID, "job.") { d.addTTLValue(tag, config.DEPLOY_JOB_TAG_TTL) }