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

Persist deleteat and deleteafter from upload instructions in mock #169

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

toscott
Copy link

@toscott toscott commented Jun 26, 2019

We noticed some 409 responses due to setting deleteAfter immediately after uploading an object to our swift cluster. Upon transitioning to include the deleteAfter in the upload instructions for an atomic call, we ran into some issues with the mock not persisting the deleteAfter/deleteAt value.

This is just to persist the deleteAfter on the object stored by the mock.

@@ -85,6 +85,9 @@ public ObjectInformation getInfo() {
uploadInstructions.getContentType() != null ?
uploadInstructions.getContentType() :
new ObjectContentType(new MimetypesFileTypeMap().getContentType(getName()));
this.deleteAt = uploadInstructions.getDeleteAt() != null ? uploadInstructions.getDeleteAt() :
uploadInstructions.getDeleteAfter() != null ?
new DeleteAt(System.currentTimeMillis() + uploadInstructions.getDeleteAfter().getExpireAfterSeconds()) : null;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bah. seconds != milliseconds..

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

Successfully merging this pull request may close these issues.

1 participant