Skip to content

Commit

Permalink
Activate Scheduling
Browse files Browse the repository at this point in the history
  • Loading branch information
scezen committed Oct 18, 2024
1 parent 56f72dd commit b0f0107
Showing 1 changed file with 1 addition and 22 deletions.
23 changes: 1 addition & 22 deletions ui/src/main/java/org/open4goods/ui/services/OpenDataService.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public void close() throws IOException {
* This method is scheduled to run periodically.
* TODO : Schedule in conf
*/
//@Scheduled(initialDelay = 1000L * 3600, fixedDelay = 1000L * 3600 * 24 * 7)
@Scheduled(initialDelay = 1000L * 3600, fixedDelay = 1000L * 3600 * 24 * 7)
@Timed(value = "OpenDataService.generateOpendata.time", description = "Time taken to generate the OpenData ZIP files", extraTags = {"service", "OpenDataService"})
public void generateOpendata() {

Expand Down Expand Up @@ -153,27 +153,6 @@ private void prepareDirectories() throws IOException {
uiConfig.tmpGtinZipFile().getParentFile().mkdirs();
}

private void processDataFiles() throws IOException {
LOGGER.info("Starting process for ISBN_13");
processAndCreateZip(ISBN_DATASET_FILENAME, BarcodeType.ISBN_13, uiConfig.tmpIsbnZipFile());

LOGGER.info("Starting process for GTIN/EAN");
processAndCreateZip(GTIN_DATASET_FILENAME, BarcodeType.ISBN_13, uiConfig.tmpGtinZipFile(), true);
}

private void moveTmpFilesToFinalDestination() throws IOException {
moveFile(uiConfig.tmpIsbnZipFile(), uiConfig.isbnZipFile());
moveFile(uiConfig.tmpGtinZipFile(), uiConfig.gtinZipFile());
}

private void moveFile(File src, File dest) throws IOException {
if (dest.exists()) {
FileUtils.deleteQuietly(dest);
}
FileUtils.moveFile(src, dest);
}


/**
* Processes and creates the ZIP files for the opendata.
*/
Expand Down

0 comments on commit b0f0107

Please sign in to comment.