diff --git a/reportservice/report_service.py b/reportservice/report_service.py
index 130885c78473355967a4724ce3e0342f05fd86c3..e2441227d4bf31c7c2a3a51f5814d05d05cee88a 100644
--- a/reportservice/report_service.py
+++ b/reportservice/report_service.py
@@ -157,8 +157,10 @@ async def build_dc_report(dc_folder, report_fmt):
         if "Submitted batch job " in line:
             jobid = line.split(" ")[3]
     logging.info("Submitted job for building a report: {}".format(jobid))
-    await wait_jobs([jobid])
-    asyncio.ensure_future(del_folder("{}/slurm-{}.out".format(temp_path, jobid)))
+
+    await asyncio.wait_for(wait_jobs([jobid]), timeout=7200)  # timeout=2hours
+    # delete folder only after the pending slurm jobs finishes
+    await del_folder("{}/slurm-{}.out".format(temp_path, jobid))
 
 
 async def push_figures(repo_master, addf):