Skip to content

Commit

Permalink
We probably shouldn't do this, so remove it again!
Browse files Browse the repository at this point in the history
  • Loading branch information
rowleya committed Feb 8, 2024
1 parent 332ad00 commit 86f13fc
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -387,9 +387,6 @@ private final class AllocSQL extends PowerSQL {
/** Get the list of allocation tasks for jobs in a given state. */
private final Query getTasks;

/** Delete an allocation task. */
private final Update delete;

/** Find a single free board. */
private final Query findFreeBoard;

Expand Down Expand Up @@ -439,7 +436,6 @@ private final class AllocSQL extends PowerSQL {
super(conn);
bumpImportance = conn.update(BUMP_IMPORTANCE);
getTasks = conn.query(getAllocationTasks);
delete = conn.update(DELETE_TASK);
findFreeBoard = conn.query(FIND_FREE_BOARD);
getRectangles = conn.query(findRectangle);
getRectangleAt = conn.query(findRectangleAt);
Expand All @@ -455,7 +451,6 @@ public void close() {
super.close();
bumpImportance.close();
getTasks.close();
delete.close();
findFreeBoard.close();
getRectangles.close();
getRectangleAt.close();
Expand Down Expand Up @@ -659,11 +654,6 @@ private Allocations allocate(Connection conn) {
log.debug("allocate for {} (job {}) failed",
task.id, task.jobId);
} else {

// If we handled it, delete the request
if (handled.size() > 0) {
sql.delete.call(task.id);
}
allocations.addAll(task.jobId, handled);
log.debug("allocate for {} (job {}): {}", task.id,
task.jobId, handled);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -659,11 +659,6 @@ public abstract class SQLQueries {
+ "FROM board_reports JOIN user_info ON reporter = user_id "
+ "WHERE board_id = :board_id";

/** Delete an allocation task. */
@Parameter("request_id")
protected static final String DELETE_TASK =
"DELETE FROM job_request WHERE req_id = :request_id";

/** Find a single free board. */
@Parameter("machine_id")
@ResultColumn("x")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,17 +173,6 @@ void noteDestroyReason() {
}
}

@Test
void deleteTask() {
assumeWritable(c);
try (var u = c.update(DELETE_TASK)) {
c.transaction(() -> {
assertEquals(List.of("request_id"), u.getParameters());
assertEquals(0, u.call(NO_JOB));
});
}
}

@Test
void allocateBoardsJob() {
assumeWritable(c);
Expand Down

0 comments on commit 86f13fc

Please sign in to comment.