Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
sphilipse committed Jan 9, 2024
1 parent 1a13bc0 commit 2dfc3a3
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions connectors/services/job_cleanup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,8 @@ class JobCleanUpService(BaseService):

def __init__(self, config):
super().__init__(config)
self.idling = int(self.service_config.get(
"job_cleanup_interval", 60 * 5))
self.native_service_types = self.config.get(
"native_service_types", []) or []
self.idling = int(self.service_config.get("job_cleanup_interval", 60 * 5))
self.native_service_types = self.config.get("native_service_types", []) or []
self.connector_ids = list(self.connectors.keys())

async def _run(self):
Expand Down Expand Up @@ -75,8 +73,7 @@ async def _process_orphaned_jobs(self):

result = await self.sync_job_index.delete_jobs(job_ids=job_ids)
if len(result["failures"]) > 0:
logger.error(
f"Error found when deleting jobs: {result['failures']}")
logger.error(f"Error found when deleting jobs: {result['failures']}")
logger.info(
f"Successfully deleted {result['deleted']} out of {result['total']} orphaned jobs"
)
Expand Down Expand Up @@ -121,8 +118,7 @@ async def _process_idle_jobs(self):
job = None
await connector.sync_done(job=job)
except Exception as e:
logger.error(
f"Failed to mark idle job #{job_id} as error: {e}")
logger.error(f"Failed to mark idle job #{job_id} as error: {e}")
finally:
total_count += 1

Expand Down

0 comments on commit 2dfc3a3

Please sign in to comment.