Skip to content

Commit 359a947

Browse files
committed
Use constants
1 parent 09aabc5 commit 359a947

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

SequenceAnalysis/src/org/labkey/sequenceanalysis/SequenceAnalysisMaintenanceTask.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@
6161
*/
6262
public class SequenceAnalysisMaintenanceTask implements MaintenanceTask
6363
{
64+
private static final String SYSTEM_MAINTENANCE_DESCRIPTION = "System Maintenance";
65+
private static final String JOB_TABLE = "Job";
66+
6467
public SequenceAnalysisMaintenanceTask()
6568
{
6669

@@ -78,13 +81,14 @@ public String getName()
7881
return "DeleteSequenceAnalysisArtifacts";
7982
}
8083

84+
// NOTE: if there is a more direct way to locate the JobID this should be replaced
8185
private void checkJobCancelled(Logger log)
8286
{
8387
// Make the assumption there is only one active maintenance job at a time:
84-
SimpleFilter filter = new SimpleFilter(FieldKey.fromString("description"), "System Maintenance").
88+
SimpleFilter filter = new SimpleFilter(FieldKey.fromString("description"), SYSTEM_MAINTENANCE_DESCRIPTION).
8589
addCondition(FieldKey.fromString("Folder"), ContainerManager.getRoot().getId()).
8690
addInClause(FieldKey.fromString("Status"), Arrays.asList(PipelineJob.TaskStatus.cancelling.name(), PipelineJob.TaskStatus.running.name()));
87-
Integer rowId = new TableSelector(DbSchema.get("pipeline", DbSchemaType.Module).getTable("Pob"), PageFlowUtil.set("RowId"), filter, null).getObject(Integer.class);
91+
Integer rowId = new TableSelector(DbSchema.get("pipeline", DbSchemaType.Module).getTable(JOB_TABLE), PageFlowUtil.set("RowId"), filter, null).getObject(Integer.class);
8892
if (rowId == null)
8993
{
9094
log.error("Unable to find rowId for job");

0 commit comments

Comments
 (0)