Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error tracking download in Install() function #275

Open
Gagafeee opened this issue Jul 1, 2023 · 0 comments
Open

Error tracking download in Install() function #275

Gagafeee opened this issue Jul 1, 2023 · 0 comments

Comments

@Gagafeee
Copy link

Gagafeee commented Jul 1, 2023

Hi,
I have the folowing code

//...
const task = installTask(await ResolveXmclVersion(version), dir, {});
await task.startAndWait({
  onUpdate(task: any, chunkSize: number) {
    //use only global task called "install"
    if (task.path === 'install') {
      console.log(task.progress + " / " + task.total);

      const downloadPercentage = Math.floor((task.progress * 100) / task.total);
      console.log('Downloading: ' + downloadPercentage + '%');
    }
  },
  onFailed(task: any, error: any) {
    //...
  },
  onSucceed(task: any, result: any) {
    if (task.path === 'install') {
      //...
    }
  }
});

Where I install a minecraft version (tested with 1.20 & 1.19), and track the task named install to have the global downloading.
In console:
image
It seems to have a first download of 34407 bytes, then another (the normal) of 23511027

This problem causes my application's progress bar to go backwards (given that download sends 100% then 0%)

is this from an error indexing the tasks names ?
or this is a new file to download before the other ?
or this is my mistake ?

Thanks for help

@Gagafeee Gagafeee changed the title Error indexing task in function Install() Error tracking download in Install() function Jul 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant