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

Check for existing user downloads not working in all cases #305

Open
MattBlissett opened this issue Jun 20, 2023 · 0 comments
Open

Check for existing user downloads not working in all cases #305

MattBlissett opened this issue Jun 20, 2023 · 0 comments

Comments

@MattBlissett
Copy link
Member

We have significant space used by duplicate user downloads, e.g.

  • 0264549-230224095556074
  • 0264553-230224095556074
  • 0264554-230224095556074
  • 0264567-230224095556074
  • 0264573-230224095556074
  • 0264574-230224095556074

With this code:

// Check for recent user downloads (of this same user) with the same predicate
PagingResponse<Download> userDownloads =
occurrenceDownloadService.listByUser(
userAuthenticated.getName(),
new PagingRequest(0, 50),
EnumSet.of(PREPARING, RUNNING, SUCCEEDED));
String existingUserDownload =
matchExistingDownload(
userDownloads,
predicateDownloadRequest,
Date.from(Instant.now().minus(4, ChronoUnit.HOURS)));
if (existingUserDownload != null) {
return existingUserDownload;
}

the user should have been sent to 0264549-230224095556074 (the first download) for all subsequent requests.

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