Skip to content

Commit 4e7b2ea

Browse files
fix: fix cron
1 parent a8665f8 commit 4e7b2ea

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

mod_ci/controllers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,8 @@ def delete_expired_instances(compute, max_runtime, project, zone, db, repository
179179
test = Test.query.filter(Test.id == test_id).first()
180180
message = "Could not complete test, time limit exceeded"
181181
progress = TestProgress(test_id, TestStatus.canceled, message)
182-
g.db.add(progress)
183-
g.db.commit()
182+
db.add(progress)
183+
db.commit()
184184

185185
gh_commit = repository.get_commit(test.commit)
186186
if gh_commit is not None:

tests/test_ci/test_controllers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ def test_delete_expired_instances(self, mock_get_running_instances, mock_update_
441441
{'status': "PENDING"}
442442
]
443443
compute.zoneOperations.return_value.get.return_value.execute = pendingOperations.pop
444-
delete_expired_instances(compute, 120, 'a', 'a', None, MagicMock())
444+
delete_expired_instances(compute, 120, 'a', 'a', MagicMock(), MagicMock())
445445
mock_get_running_instances.assert_called_once()
446446
mock_update_github_status.assert_called_once()
447447

0 commit comments

Comments
 (0)