Re run Failed Background Jobs

How to re enqueue failed back ground jobs, I am using below function
def get_failed_bg_jobs():
#Get all the failed jobs
failed_job_list = frappe.db.sql(“”“select * from tabBack Ground Job Logs
where method = ‘method path’ and
job_status != “FINISHED” and job_id = ‘98002ce9-37fa-4172-883c-d590a8998fc8’
“””.format(),as_dict = 1,debug=1)
def enqueue_failed_bg_jobs(failed_job_list):
for job_list in failed_job_list:
try:
print(‘111111111111111111111111111111111’,job_list)
frappe.enqueue(method=getattr(job_list, ‘method’),
queue=‘long’,timeout=3600,event=None,
is_async=True,job_name=job_list.get(‘job_name’),now=False,
bgjob_type = job_list.get(‘bgjob_type’),
kwargs = job_list.get(‘row_data’),job_id = job_list.get(‘jo’))
except Exception as e:
print(‘11111111111111111111’,frappe.get_traceback())
enqueue_failed_bg_jobs(failed_job_list)