This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tempfile | |
import json | |
from google.cloud import storage | |
def upload_from_temp_file(some_data): | |
with tempfile.NamedTemporaryFile() as fp: | |
json_data = json.dumps(some_data) | |
fp.write(json_data.encode()) | |
fp.flush() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func BytesArrayToString(data []bytes) string { | |
bodyBytes, perr := ioutil.ReadAll(data) | |
if perr != nil { | |
fmt.Print("UH OH") | |
} | |
bodyString := string(bodyBytes) | |
return bodyString | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function handleRetry( | |
functionToRetry, | |
functionName, | |
operationId, | |
previousAttemptNumber, | |
...args | |
) { | |
try { | |
return functionToRetry(...args); | |
} catch (err) { |
OlderNewer