Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,21 +61,15 @@ public long getLastJobSuccessDateMillis() {
public void updateJobSuccess(Long jobId, long startMillis, long endMillis, long execTime, boolean success) {
TransactionLegacy txn = TransactionLegacy.open(TransactionLegacy.USAGE_DB);
try {
txn.start();

UsageJobVO job = lockRow(jobId, Boolean.TRUE);
UsageJobVO jobForUpdate = createForUpdate();
jobForUpdate.setStartMillis(startMillis);
jobForUpdate.setEndMillis(endMillis);
jobForUpdate.setExecTime(execTime);
jobForUpdate.setStartDate(new Date(startMillis));
jobForUpdate.setEndDate(new Date(endMillis));
jobForUpdate.setSuccess(success);
update(job.getId(), jobForUpdate);

txn.commit();
update(jobId, jobForUpdate);
} catch (Exception ex) {
txn.rollback();
logger.error("error updating job success date", ex);
throw new CloudRuntimeException(ex.getMessage());
} finally {
Expand Down
Loading