mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Reset pending-only jobs upon management server startup
This commit is contained in:
parent
e4d9216222
commit
28bbba3cea
@ -41,9 +41,9 @@ import com.cloud.utils.db.Transaction;
|
||||
public class AsyncJobDaoImpl extends GenericDaoBase<AsyncJobVO, Long> implements AsyncJobDao {
|
||||
private static final Logger s_logger = Logger.getLogger(AsyncJobDaoImpl.class.getName());
|
||||
|
||||
private SearchBuilder<AsyncJobVO> pendingAsyncJobSearch;
|
||||
private SearchBuilder<AsyncJobVO> pendingAsyncJobsSearch;
|
||||
private SearchBuilder<AsyncJobVO> expiringAsyncJobSearch;
|
||||
private final SearchBuilder<AsyncJobVO> pendingAsyncJobSearch;
|
||||
private final SearchBuilder<AsyncJobVO> pendingAsyncJobsSearch;
|
||||
private final SearchBuilder<AsyncJobVO> expiringAsyncJobSearch;
|
||||
|
||||
public AsyncJobDaoImpl() {
|
||||
pendingAsyncJobSearch = createSearchBuilder();
|
||||
@ -105,7 +105,7 @@ public class AsyncJobDaoImpl extends GenericDaoBase<AsyncJobVO, Long> implements
|
||||
|
||||
@DB
|
||||
public void resetJobProcess(long msid) {
|
||||
String sql = "UPDATE async_job SET job_status=2, job_result='job cancelled because of management server restart' where job_complete_msid=? OR (job_complete_msid IS NULL AND job_init_msid=?)";
|
||||
String sql = "UPDATE async_job SET job_status=2, job_result='job cancelled because of management server restart' where job_status=0 AND (job_complete_msid=? OR (job_complete_msid IS NULL AND job_init_msid=?))";
|
||||
|
||||
Transaction txn = Transaction.currentTxn();
|
||||
PreparedStatement pstmt = null;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user