Skip to content

Commit

Permalink
Do not (un)set readOnly in ImportFilesToSpace step anymore
Browse files Browse the repository at this point in the history
NOTE: Space will be deactivated when dropping indices and re-activated when being marked for maintenance (after all indices have been created again)

Signed-off-by: Benjamin Rögner <[email protected]>
  • Loading branch information
roegi committed Dec 9, 2024
1 parent 7e1bda7 commit 1095aa1
Showing 1 changed file with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ public boolean validate() throws ValidationException {
infoLog(JOB_VALIDATE, this);
//Check if the space is actually existing
Space space = space();
if(space.isReadOnly())
if (space.isReadOnly())
throw new ValidationException("Data can not be written to target " + space.getId() + " as it is in read-only mode.");

if (entityPerLine == FeatureCollection && format == CSV_JSON_WKB)
Expand Down Expand Up @@ -294,9 +294,6 @@ private void _execute(boolean isResume) throws WebClientException, SQLException,
else {
//TODO: Move resume logic into #resume()
if (!isResume) {
infoLog(STEP_EXECUTE, this, "Set ReadOnly");
hubWebClient().patchSpace(getSpaceId(), Map.of("readOnly", true));

infoLog(STEP_EXECUTE, this,"Retrieve new version");
long newVersion = increaseVersionSequence();

Expand Down Expand Up @@ -456,11 +453,8 @@ protected void onAsyncSuccess() throws WebClientException,

cleanUpDbRelatedResources();

infoLog(STEP_ON_ASYNC_SUCCESS, this,"Release READONLY");
hubWebClient().patchSpace(getSpaceId(), Map.of(
"readOnly", false,
"contentUpdatedAt", Core.currentTimeMillis()
));
infoLog(STEP_ON_ASYNC_SUCCESS, this,"Set contentUpdatedAt on target space");
hubWebClient().patchSpace(getSpaceId(), Map.of("contentUpdatedAt", Core.currentTimeMillis()));

}
catch (SQLException e) {
Expand Down

0 comments on commit 1095aa1

Please sign in to comment.