Skip to content

Commit

Permalink
Merge 24.11 to 25.1
Browse files Browse the repository at this point in the history
  • Loading branch information
labkey-teamcity committed Jan 7, 2025
2 parents 22a7d5f + 03988bf commit ecdfec7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 26 deletions.
35 changes: 10 additions & 25 deletions src/org/labkey/targetedms/SkylineDocImporter.java
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ public TargetedMSRun importRun(RunInfo runInfo, PipelineJob job) throws IOExcept
}

// Skip if run was already fully imported
if (runInfo.isAlreadyImported() && run.getStatusId() == SkylineDocImporter.STATUS_SUCCESS)
if (run.getStatusId() == SkylineDocImporter.STATUS_SUCCESS)
{
_log.info(_expData.getName() + " has already been imported so it does not need to be imported again");
return run;
Expand Down Expand Up @@ -2583,60 +2583,45 @@ protected static void updateRunStatus(long runId, String status, int statusId)
public static class RunInfo implements Serializable
{
private final long _runId;
private final boolean _alreadyImported;

@JsonCreator
private RunInfo(@JsonProperty("_runId") long runId, @JsonProperty("_alreadyImported") boolean alreadyImported)
private RunInfo(@JsonProperty("_runId") long runId)
{
_runId = runId;

_alreadyImported = alreadyImported;
}

public long getRunId()
{
return _runId;
}

public boolean isAlreadyImported()
{
return _alreadyImported;
}
}

public RunInfo prepareRun()
{
try (DbScope.Transaction transaction = TargetedMSManager.getSchema().getScope().ensureTransaction(_schemaLock))
{
boolean alreadyImported = false;

// Don't import if we've already imported this file (undeleted run exists matching this file name)
_runId = getRun();
if (_runId != -1)
{
alreadyImported = true;
}
else
TargetedMSRun run = getRun();
if (run == null)
{
_log.info("Starting import from " + _expData.getName());
_runId = createRun();
run = createRun();
}

transaction.commit();
return new RunInfo(_runId, alreadyImported);
return new RunInfo(run.getRunId());
}
}

protected long getRun()
protected TargetedMSRun getRun()
{
SimpleFilter filter = new SimpleFilter(FieldKey.fromParts("DataId"), _expData.getRowId());
filter.addCondition(FieldKey.fromParts("Container"), _container.getId());
filter.addCondition(FieldKey.fromParts("Deleted"), Boolean.FALSE);
TargetedMSRun run = new TableSelector(TargetedMSManager.getTableInfoRuns(), filter, null).getObject(TargetedMSRun.class);
return run != null ? run.getId() : -1;
return new TableSelector(TargetedMSManager.getTableInfoRuns(), filter, null).getObject(TargetedMSRun.class);
}

protected long createRun()
protected TargetedMSRun createRun()
{
TargetedMSRun run = TargetedMSManager.getRunByDataId(_expData.getRowId(), _container);
if (run != null)
Expand All @@ -2653,7 +2638,7 @@ protected long createRun()
run.setRepresentativeDataState(_representative == null ? RunRepresentativeDataState.NotRepresentative : _representative);

run = Table.insert(_user, TargetedMSManager.getTableInfoRuns(), run);
return run.getId();
return run;
}

protected void logError(String message, Exception e)
Expand Down
2 changes: 1 addition & 1 deletion src/org/labkey/targetedms/TargetedMSModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ public String getName()
@Override
public Double getSchemaVersion()
{
return 24.005;
return 25.000;
}

@Override
Expand Down

0 comments on commit ecdfec7

Please sign in to comment.