add signatures to messages to avoid double processing
This commit is contained in:
13
weed/pb/filer_pb/signature.go
Normal file
13
weed/pb/filer_pb/signature.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package filer_pb
|
||||
|
||||
func (r *CreateEntryRequest) AddSignature(sig int32) {
|
||||
r.Signatures = append(r.Signatures, sig)
|
||||
}
|
||||
func (r *CreateEntryRequest) HasSigned(sig int32) bool {
|
||||
for _, s := range r.Signatures {
|
||||
if s == sig {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
Reference in New Issue
Block a user