Skip to content

Commit c0a4e71

Browse files
authored
Merge pull request #162 from Snoyark/suffixAddition
change name suffix resolution to account for sub-second api calls
2 parents 5825d81 + 93bae64 commit c0a4e71

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/smexperiments/_utils.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# language governing permissions and limitations under the License.
1313
import os
1414
import random
15-
import time
15+
from datetime import datetime
1616

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

4949

5050
def name(prefix):

0 commit comments

Comments
 (0)