hotfix added endpoint to restart zip all files for saas migration
This commit is contained in:
parent
c636a67277
commit
ba82b94db0
@ -99,6 +99,12 @@ public class MigrationStatusController implements MigrationStatusResource {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void retryZipFiles(){
|
||||||
|
saasMigrationService.restartZipFiles();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private static boolean migrationIsFinished(MigrationStatusResponse migrationStatus) {
|
private static boolean migrationIsFinished(MigrationStatusResponse migrationStatus) {
|
||||||
|
|
||||||
return migrationStatus.getFilesInStatus().entrySet().stream().filter(e -> e.getValue() > 0).allMatch(e -> e.getKey().equals(FINISHED) || e.getKey().equals(ERROR));
|
return migrationStatus.getFilesInStatus().entrySet().stream().filter(e -> e.getValue() > 0).allMatch(e -> e.getKey().equals(FINISHED) || e.getKey().equals(ERROR));
|
||||||
|
|||||||
@ -17,6 +17,8 @@ public interface MigrationStatusResource {
|
|||||||
String REVERT_MIGRATION_REST_PATH = ExternalApi.BASE_PATH + "/revert_migration";
|
String REVERT_MIGRATION_REST_PATH = ExternalApi.BASE_PATH + "/revert_migration";
|
||||||
String RETRY_MIGRATION_REST_PATH = ExternalApi.BASE_PATH + "/retry_migration";
|
String RETRY_MIGRATION_REST_PATH = ExternalApi.BASE_PATH + "/retry_migration";
|
||||||
|
|
||||||
|
String RETRY_ZIP_FILES_REST_PATH = ExternalApi.BASE_PATH + "/retry_zip_files";
|
||||||
|
|
||||||
String FILE_ID = "fileId";
|
String FILE_ID = "fileId";
|
||||||
String FILE_ID_PATH_VARIABLE = "/{" + FILE_ID + "}";
|
String FILE_ID_PATH_VARIABLE = "/{" + FILE_ID + "}";
|
||||||
|
|
||||||
@ -48,6 +50,13 @@ public interface MigrationStatusResource {
|
|||||||
ResponseEntity<?> requeueErrorFiles();
|
ResponseEntity<?> requeueErrorFiles();
|
||||||
|
|
||||||
|
|
||||||
|
@ResponseBody
|
||||||
|
@PostMapping(value = RETRY_ZIP_FILES_REST_PATH)
|
||||||
|
@Operation(summary = "Restart zip all files in storage that are not zipped", description = "None")
|
||||||
|
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "Success.")})
|
||||||
|
void retryZipFiles();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,6 +9,7 @@ import java.util.Set;
|
|||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
|
||||||
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
||||||
|
import org.springframework.scheduling.annotation.Async;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import com.iqser.red.service.persistence.management.v1.processor.entity.annotations.AnnotationEntityId;
|
import com.iqser.red.service.persistence.management.v1.processor.entity.annotations.AnnotationEntityId;
|
||||||
@ -133,6 +134,7 @@ public class SaasMigrationService implements TenantSyncService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Async
|
||||||
public void requeueErrorFiles() {
|
public void requeueErrorFiles() {
|
||||||
|
|
||||||
automaticAnalysisJob.stopForTenant(TenantContext.getTenantId());
|
automaticAnalysisJob.stopForTenant(TenantContext.getTenantId());
|
||||||
@ -142,6 +144,14 @@ public class SaasMigrationService implements TenantSyncService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Async
|
||||||
|
public void restartZipFiles(){
|
||||||
|
log.info("Starting uncompressed files migration ...");
|
||||||
|
uncompressedFilesMigrationService.migrateUncompressedFiles(TenantContext.getTenantId());
|
||||||
|
log.info("Finished uncompressed files migration ...");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public void handleLayoutParsingFinished(String dossierId, String fileId) {
|
public void handleLayoutParsingFinished(String dossierId, String fileId) {
|
||||||
|
|
||||||
if (!layoutParsingFilesExist(dossierId, fileId)) {
|
if (!layoutParsingFilesExist(dossierId, fileId)) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user