MCPcopy Index your code
hub / github.com/google/clusterfuzz / update_source_code_if_needed

Function update_source_code_if_needed

src/python/bot/startup/run.py:174–187  ·  view source on GitHub ↗

Update source code if needed.

()

Source from the content-addressed store, hash-verified

172
173
174def update_source_code_if_needed():
175 """Update source code if needed."""
176 try:
177 # Update the bot source, if there's a newer version.
178 newer_source_revision = update_task.get_newer_source_revision()
179 if newer_source_revision is not None:
180 # If source code needs update, stop the heartbeat first. As otherwise,
181 # we can run into exceptions if source code changed from underneath
182 # a running process.
183 stop_heartbeat()
184
185 update_task.update_source_code()
186 except Exception:
187 logs.error('Failed to update source.')
188
189
190def run_loop(bot_command, heartbeat_command):

Callers 1

run_loopFunction · 0.85

Calls 2

stop_heartbeatFunction · 0.85
errorMethod · 0.80

Tested by

no test coverage detected