@@ -110,7 +110,7 @@ def start_platforms(repository, delay=None, platform=None) -> None:
110
110
db = create_session (config .get ('DATABASE_URI' , '' ))
111
111
112
112
compute = get_compute_service_object ()
113
- delete_expired_instances (compute , vm_max_runtime , project , zone )
113
+ delete_expired_instances (compute , vm_max_runtime , project , zone , db , repository )
114
114
115
115
if platform is None or platform == TestPlatform .linux :
116
116
log .info ('Define process to run Linux GCP instances' )
@@ -155,7 +155,7 @@ def is_instance_testing(vm_name) -> bool:
155
155
return False
156
156
157
157
158
- def delete_expired_instances (compute , max_runtime , project , zone ) -> None :
158
+ def delete_expired_instances (compute , max_runtime , project , zone , db , repository ) -> None :
159
159
"""
160
160
Get all running instances and delete instances whose maximum runtime limit is reached.
161
161
@@ -182,8 +182,6 @@ def delete_expired_instances(compute, max_runtime, project, zone) -> None:
182
182
g .db .add (progress )
183
183
g .db .commit ()
184
184
185
- gh = Github (g .github ['bot_token' ])
186
- repository = gh .get_repo (f"{ g .github ['repository_owner' ]} /{ g .github ['repository' ]} " )
187
185
gh_commit = repository .get_commit (test .commit )
188
186
if gh_commit is not None :
189
187
update_status_on_github (gh_commit , Status .ERROR , message , f"CI - { platform_name } " )
0 commit comments