Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 29ef01e

Browse files
author
Ace Nassri
authored
Retries: add clarification comment + syntax tweaks (GoogleCloudPlatform#2200)
1 parent 333677e commit 29ef01e

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

functions/tips/main.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,8 @@ def retry_or_not(data, context):
182182
None; output is written to Stackdriver Logging
183183
"""
184184

185-
if data.data.get('retry'):
186-
try_again = True
187-
else:
188-
try_again = False
185+
# Retry based on a user-defined parameter
186+
try_again = data.data.get('retry') is not None
189187

190188
try:
191189
raise RuntimeError('I failed you')

0 commit comments

Comments
 (0)