Skip to content

Commit

Permalink
fix: de-duplicate metadata submission after one minute (#347)
Browse files Browse the repository at this point in the history
re-submission of "same" changes is a valid use case

closes #340
  • Loading branch information
dwinston committed Nov 3, 2023
1 parent df1e0a1 commit cbead62
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion nmdc_runtime/api/endpoints/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
import os
import re
import tempfile
from datetime import datetime
from functools import lru_cache
from json import JSONDecodeError
from pathlib import Path
from time import time_ns
from typing import List, Optional, Set, Tuple
from urllib.parse import parse_qs, urlparse
from zoneinfo import ZoneInfo

from bson import json_util
from dagster import DagsterRunStatus
Expand Down Expand Up @@ -442,7 +444,11 @@ def persist_content_and_get_drs_object(
**drs_metadata_for(
filepath,
base={
"description": description + f" (created by/for {username})",
"description": (
description
+ f" (created by/for {username}"
+ f" at {datetime.now(tz=ZoneInfo('America/Los_Angeles')).isoformat(timespec='minutes')})"
),
"access_methods": [{"access_id": drs_id}],
},
)
Expand Down

0 comments on commit cbead62

Please sign in to comment.