Skip to content

sender: fix SkipDeepCopySender check not working - #609

Merged
wonderflow merged 1 commit into
qiniu:masterfrom
unknwon:fix-skip-deep-copy-sender
Jul 17, 2018
Merged

wonderflow merged 1 commit into
qiniu:masterfrom
unknwon:fix-skip-deep-copy-sender

Conversation

@unknwon

@unknwon unknwon commented Jul 17, 2018

Copy link
Copy Markdown
Contributor

优化 SkipDeepCopySender 的接口实现判断

@unknwon
unknwon requested a review from wonderflow July 17, 2018 12:29
Comment thread sender/fault_tolerant.go
func (ft *FtSender) SkipDeepCopy() bool {
_, ok := ft.innerSender.(SkipDeepCopySender)
return ok
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

fault_tolerant_test.go里可以加个测试,true和false都可以测到。pandora_sender应该就是return false的情况,mock sender就是return true的情况

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

加好了

@redHJ

redHJ commented Jul 17, 2018

Copy link
Copy Markdown
Collaborator

lgtm

Comment thread sender/fault_tolerant.go Outdated
func (_ *FtSender) SkipDeepCopy() {}
func (ft *FtSender) SkipDeepCopy() bool {
_, ok := ft.innerSender.(SkipDeepCopySender)
return ok

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ss, ok := ft.innerSender.(SkipDeepCopySender)
if ok{
return ss. SkipDeepCopy()
}
return false

@wonderflow
wonderflow merged commit 096fcd7 into qiniu:master Jul 17, 2018
@unknwon
unknwon deleted the fix-skip-deep-copy-sender branch July 18, 2018 02:06
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.

3 participants