Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bot] Merge 24.11 to 25.1 #997

Merged
merged 3 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
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
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
Loading