Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
oittaa committed Feb 13, 2021
1 parent d3fd42c commit 5c3e6d9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/main.py
Expand Up @@ -266,11 +266,12 @@ def upload_blob(bucket_name, source_file_name, destination_blob_name): # pragma
# source_file_name = "local/path/to/file"
# destination_blob_name = "storage-object-name"

now = datetime.datetime.utcnow()
bucket = storage_client.bucket(bucket_name)
blob = bucket.blob(destination_blob_name)
blob.custom_time = now

blob.upload_from_filename(source_file_name)
update_blob_custom_time(bucket_name, destination_blob_name)
logging.debug(
"File %s uploaded to %s.", source_file_name, destination_blob_name)

Expand Down

0 comments on commit 5c3e6d9

Please sign in to comment.