@@ -198,24 +198,29 @@ def sync_repos_for_org(organization_integration_id: int) -> None:
198198 removed_id_list = list (removed_ids )
199199 restored_id_list = list (restored_ids )
200200
201- # TODO: Switch to apply_async once the tasks are deployed to all workers
202201 for config_batch in chunked (new_repo_configs , SYNC_BATCH_SIZE ):
203- create_repos_batch (
204- organization_integration_id = organization_integration_id ,
205- repo_configs = config_batch ,
202+ create_repos_batch .apply_async (
203+ kwargs = {
204+ "organization_integration_id" : organization_integration_id ,
205+ "repo_configs" : config_batch ,
206+ }
206207 )
207208
208209 if _has_feature ("organizations:scm-repo-auto-sync-removal" , rpc_org ):
209210 for removed_batch in chunked (removed_id_list , SYNC_BATCH_SIZE ):
210- disable_repos_batch (
211- organization_integration_id = organization_integration_id ,
212- external_ids = removed_batch ,
211+ disable_repos_batch .apply_async (
212+ kwargs = {
213+ "organization_integration_id" : organization_integration_id ,
214+ "external_ids" : removed_batch ,
215+ }
213216 )
214217
215218 for restored_batch in chunked (restored_id_list , SYNC_BATCH_SIZE ):
216- restore_repos_batch (
217- organization_integration_id = organization_integration_id ,
218- external_ids = restored_batch ,
219+ restore_repos_batch .apply_async (
220+ kwargs = {
221+ "organization_integration_id" : organization_integration_id ,
222+ "external_ids" : restored_batch ,
223+ }
219224 )
220225
221226
0 commit comments