Skip to content

Commit

Permalink
Merge pull request #162 from Snoyark/suffixAddition
Browse files Browse the repository at this point in the history
change name suffix resolution to account for sub-second api calls
  • Loading branch information
Snoyark authored May 10, 2022
2 parents 5825d81 + 93bae64 commit c0a4e71
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/smexperiments/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# language governing permissions and limitations under the License.
import os
import random
import time
from datetime import datetime

import boto3
import botocore
Expand Down Expand Up @@ -44,7 +44,7 @@ def boto_session():
def suffix():
"""Generate a random string of length 4"""
alph = "abcdefghijklmnopqrstuvwxyz"
return "-".join([time.strftime("%Y-%m-%d-%H%M%S"), "".join(random.sample(alph, 4))])
return "-".join([datetime.utcnow().strftime("%Y-%m-%d-%H%M%S%f"), "".join(random.sample(alph, 4))])


def name(prefix):
Expand Down

0 comments on commit c0a4e71

Please sign in to comment.