Skip to content

Commit

Permalink
Load default_tag_expiration from yeti.conf (#1147)
Browse files Browse the repository at this point in the history
Co-authored-by: Thomas Chopitea <tomchop@gmail.com>
  • Loading branch information
mbonino and tomchop authored Oct 14, 2024
1 parent 5424c36 commit 25ae3c6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
9 changes: 8 additions & 1 deletion core/schemas/tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,17 @@
from pydantic import Field

from core import database_arango
from core.config.config import yeti_config
from core.helpers import now
from core.schemas.model import YetiModel

DEFAULT_EXPIRATION = datetime.timedelta(days=30) # Completely arbitrary
DEFAULT_EXPIRATION = datetime.timedelta(
days=yeti_config.get(
"tag",
"default_tag_expiration",
default=90, # Completely arbitrary
)
)

MAX_TAG_LENGTH = 50
MAX_TAGS_REQUEST = 50
Expand Down
4 changes: 2 additions & 2 deletions yeti.conf.sample
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ enabled = True
##
## Use these settings to configure Yeti tags.
## If you specify default_tag_expiration = 7776000, then the tag will expire for 90 days.
## Value must be in seconds (7776000 seconds is 90 days).
## Value must be in days.
##

# default_tag_expiration = 7776000
# default_tag_expiration = 90

[arangodb]

Expand Down

0 comments on commit 25ae3c6

Please sign in to comment.