Wauplin HF staff commited on
Commit
6e02f70
1 Parent(s): b07b268

no need to notify if repo already deleted

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -115,6 +115,8 @@ def is_pr_synced(space_id: str, pr_num: int) -> bool:
115
 
116
 
117
  def sync_ci_space(space_id: str, pr_num: int, private: bool) -> None:
 
 
118
  # Create a temporary space for CI if didn't exist
119
  ci_space_id = _get_ci_space_id(space_id=space_id, pr_num=pr_num)
120
 
@@ -173,12 +175,15 @@ def sync_ci_space(space_id: str, pr_num: int, private: bool) -> None:
173
 
174
 
175
  def delete_ci_space(space_id: str, pr_num: int) -> None:
 
 
176
  # Delete
177
  ci_space_id = _get_ci_space_id(space_id=space_id, pr_num=pr_num)
178
  try:
179
  delete_repo(repo_id=ci_space_id, repo_type="space")
180
  except RepositoryNotFoundError:
181
- pass
 
182
 
183
  # Notify about deletion
184
  notify_pr(space_id=space_id, pr_num=pr_num, action="delete")
 
115
 
116
 
117
  def sync_ci_space(space_id: str, pr_num: int, private: bool) -> None:
118
+ print(f"New task: sync ephemeral env for {space_id} (PR {pr_num})")
119
+
120
  # Create a temporary space for CI if didn't exist
121
  ci_space_id = _get_ci_space_id(space_id=space_id, pr_num=pr_num)
122
 
 
175
 
176
 
177
  def delete_ci_space(space_id: str, pr_num: int) -> None:
178
+ print(f"New task: delete ephemeral env for {space_id} (PR {pr_num})")
179
+
180
  # Delete
181
  ci_space_id = _get_ci_space_id(space_id=space_id, pr_num=pr_num)
182
  try:
183
  delete_repo(repo_id=ci_space_id, repo_type="space")
184
  except RepositoryNotFoundError:
185
+ # Repo did not exist: no need to notify
186
+ return
187
 
188
  # Notify about deletion
189
  notify_pr(space_id=space_id, pr_num=pr_num, action="delete")