Skip to content

Commit

Permalink
driver: move drop PendingRequest creation timestamp as argument
Browse files Browse the repository at this point in the history
  • Loading branch information
kofemann committed Dec 20, 2021
1 parent dc31938 commit 35a7056
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions src/main/java/org/dcache/nearline/cta/CtaNearlineStorage.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import java.net.InetSocketAddress;
import java.net.URI;
import java.net.UnknownHostException;
import java.time.Instant;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
Expand Down Expand Up @@ -196,7 +195,7 @@ public void onNext(ArchiveResponse response) {
);

var cancelRequest = ctaRequestFactory.cancelValueOf(ar, response);
pendingRequests.put(id, new PendingRequest(Instant.now(), r) {
pendingRequests.put(id, new PendingRequest(r) {
@Override
public void cancel() {
// on cancel send the request to CTA; on success cancel the requests
Expand Down Expand Up @@ -278,7 +277,7 @@ public void onNext(RetrieveResponse response) {
response.getReqId()
);
var cancelRequest = ctaRequestFactory.cancelValueOf(rr, response);
pendingRequests.put(id, new PendingRequest(Instant.now(), r) {
pendingRequests.put(id, new PendingRequest(r) {
@Override
public void cancel() {
// on cancel send the request to CTA; on success cancel the requests
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/dcache/nearline/cta/PendingRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ public class PendingRequest {
*/
private final NearlineRequest request;

public PendingRequest(Instant submissionTime, NearlineRequest request) {
this.submissionTime = submissionTime;
public PendingRequest(NearlineRequest request) {
this.submissionTime = Instant.now();
this.request = request;
}

Expand Down

0 comments on commit 35a7056

Please sign in to comment.