Skip to content

Commit

Permalink
optimize: remove links/links dir create
Browse files Browse the repository at this point in the history
  • Loading branch information
li-guohao committed Aug 14, 2023
1 parent 33ba8f6 commit 3aed15d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
group=run.ikaros.plugin.file
description=A local files import plugin for ikaros.
version=0.6.1
version=0.6.2
11 changes: 3 additions & 8 deletions src/main/java/run/ikaros/plugin/file/LocalFilesImportPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
import java.util.Objects;
import lombok.extern.slf4j.Slf4j;

import static run.ikaros.api.constant.FileConst.DEFAULT_FOLDER_ROOT_ID;

@Slf4j
@Component
public class LocalFilesImportPlugin extends BasePlugin {
Expand Down Expand Up @@ -75,17 +77,10 @@ protected void linkFiles() {
log.info("mkdir links dir, path={}", linksDir);
}

folderOperate.findByParentIdAndName(FileConst.DEFAULT_FOLDER_ROOT_ID,
FileConst.DEFAULT_IMPORT_DIR_NAME)
.switchIfEmpty(folderOperate.create(FileConst.DEFAULT_FOLDER_ROOT_ID,
FileConst.DEFAULT_IMPORT_DIR_NAME)
.doOnSuccess(folder -> log.info("create links dir and id={}", folder.getId())))
.map(Folder::getId)
.flatMap(linksFolderId -> handleImportDirFile(linksDir, linksFolderId))
handleImportDirFile(linksDir, DEFAULT_FOLDER_ROOT_ID)
.subscribeOn(Schedulers.parallel())
.subscribe();


log.info("end import links dir files, time: {}", System.currentTimeMillis() - start);
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: PluginLocalFilesImport
# plugin entry class that extends BasePlugin
clazz: run.ikaros.plugin.file.LocalFilesImportPlugin
# plugin 'version' is a valid semantic version string (see semver.org).
version: 0.6.1
version: 0.6.2
requires: ">=0.6.1"
author:
name: Ikaros OSS Team
Expand Down

0 comments on commit 3aed15d

Please sign in to comment.