Skip to content
This repository has been archived by the owner on Sep 6, 2019. It is now read-only.

Copying multiple files #49

Open
jkawamoto opened this issue Nov 29, 2017 · 2 comments
Open

Copying multiple files #49

jkawamoto opened this issue Nov 29, 2017 · 2 comments

Comments

@jkawamoto
Copy link
Member

FileWatcher only checks when the last DirectoryChangeEvent occurred, and if it did in last 3 sec, skips other processes as the following snippet shows:

long currentTime = System.currentTimeMillis();
if (currentTime < lastEventTime + 3000) {
// last file event was less then 3 seconds ago
return;
}

In this implementation, I think, if a user copies many files at the same time, FileWatcher is going to wait until all file copies are finished.

@kaloyan-raev
Copy link
Contributor

Exactly, this is by design. We also have this:

public void run() {
// check if there are local file operations in progress
if (App.getInstance().getFileWatcher().isInProgress()) {
System.out.println("Skip checking for changes - local file operations in progress...");
return;
}

For the moment I want to reduce the risk where the check state task runs on partially copied files. I wanted to have a safe and stable, yet not completely optimal, implementation as the base. We will optimize it later. For the moment, I believe it is enough for the initial community release.

@jkawamoto
Copy link
Member Author

That makes sense and yes, I think it’s enough for now, too.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants