-
Notifications
You must be signed in to change notification settings - Fork 110
api, chunk, storage: anonymous uploads #1828
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM already.
- not sure enough test coverage
- does anonymous header matter for pinned upload too?
- sync mode should be eliminated now its not checked right?
- full cli support
- documentation
api/http/middleware.go
Outdated
@@ -131,8 +132,8 @@ func InitUploadTag(h http.Handler, tags *chunk.Tags) http.Handler { | |||
} | |||
|
|||
log.Trace("creating tag", "tagName", tagName, "estimatedTotal", estimatedTotal) | |||
|
|||
t, err := tags.Create(tagName, estimatedTotal) | |||
anon := anonTag == "true" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe to make it case insensitive?
case chunk.ModeSetSyncPull: | ||
if tag.Anonymous { | ||
// this will not get called twice because we remove the item in L217 | ||
tag.Inc(chunk.StateSent) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would improve this function to increment tag counters only if the batch is successfully written, probably returning bool variables that would be handled in set method.
This can be left for later when tags are persisted. Without persistence, I do not think that it matters.
8165eb8
to
c080aca
Compare
Working on it
Well:
Once the code works - gladly |
This is beyond me @acud . Would you walk me through this? |
d11164f
to
e04f33e
Compare
…f ModeSetSyncPull and ModeSetSyncPush
…g values as per pr review
The linter is still complaining https://travis-ci.org/ethersphere/swarm/jobs/594965019#L490. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @acud. LGTM.
No description provided.