Skip to content

Commit

Permalink
Remove unused checkRetries API method. (#970)
Browse files Browse the repository at this point in the history
  • Loading branch information
splhack committed May 2, 2021
1 parent 895254a commit 9037dcb
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 33 deletions.
9 changes: 0 additions & 9 deletions cuebot/src/main/java/com/imageworks/spcue/dao/FrameDao.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,6 @@ public interface FrameDao {
*/
public FrameDetail findLongestFrame(JobInterface job);

/**
* Checks to see how many retries a frame has. If that number
* is greater than or equal to the jobs max retries, the frame
* is marked as dead.
*
* @param frame
*/
void checkRetries(FrameInterface frame);

/**
* Batch inserts a frameSet of frames.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -647,21 +647,6 @@ public FrameInterface findFrame(JobInterface job, String name) {
FRAME_MAPPER, name, job.getJobId());
}

@Override
public void checkRetries(FrameInterface frame) {
int max_retries = getJdbcTemplate().queryForObject(
"SELECT int_max_retries FROM job WHERE pk_job=?", Integer.class,
frame.getJobId());

if (getJdbcTemplate().queryForObject(
"SELECT int_retries FROM frame WHERE pk_frame=?", Integer.class,
frame.getFrameId()) >= max_retries) {
getJdbcTemplate().update(
"UPDATE frame SET str_state=? WHERE pk_frame=?",
FrameState.DEAD.toString(), frame.getFrameId());
}
}

private static final String UPDATE_FRAME_STATE =
"UPDATE " +
"frame "+
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,6 @@ public JobDetail launchJob() {
return jobManager.findJobDetail("pipe-dev.cue-testuser_shell_v1");
}

@Test
@Transactional
@Rollback(true)
public void testCheckRetries() {
JobDetail job = launchJob();
frameDao.checkRetries(frameDao.findFrame(job,"0001-pass_1"));
// TODO: check to see if it actually works
}

@Test
@Transactional
@Rollback(true)
Expand Down

0 comments on commit 9037dcb

Please sign in to comment.