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

worker panic when arg is int64 type #4

Open
tt67wq opened this issue Dec 17, 2018 · 0 comments
Open

worker panic when arg is int64 type #4

tt67wq opened this issue Dec 17, 2018 · 0 comments

Comments

@tt67wq
Copy link

tt67wq commented Dec 17, 2018

when I pass a int64 arg to worker

panic: reflect: Call using float64 as type int64

goroutine 75 [running]:
reflect.Value.call(0xd1fca0, 0xecb8c0, 0x13, 0xe63490, 0x4, 0xc420172660, 0x4, 0x4, 0xcc2660, 0xcc38e0, ...)
	/usr/local/src/go/src/reflect/value.go:371 +0x1167
reflect.Value.Call(0xd1fca0, 0xecb8c0, 0x13, 0xc420172660, 0x4, 0x4, 0xc42039fe68, 0xbf0c71, 0x40d9b2)
	/usr/local/src/go/src/reflect/value.go:302 +0xa4
s4s/vendor/github.com/gocelery/gocelery.runTaskFunc(0xc42039ff38, 0xc420172600, 0xd1fca0, 0xecb8c0, 0x13)
	/home/work/s4s_build/src/s4s/vendor/github.com/gocelery/gocelery/worker.go:158 +0x371
s4s/vendor/github.com/gocelery/gocelery.(*CeleryWorker).RunTask(0xc420063140, 0xc420172600, 0x0, 0x0, 0x401360)
	/home/work/s4s_build/src/s4s/vendor/github.com/gocelery/gocelery/worker.go:132 +0x217
s4s/vendor/github.com/gocelery/gocelery.(*CeleryWorker).StartWorker.func1(0xc420063140, 0x1)
	/home/work/s4s_build/src/s4s/vendor/github.com/gocelery/gocelery/worker.go:55 +0xb6
created by s4s/vendor/github.com/gocelery/gocelery.(*CeleryWorker).StartWorker
	/home/work/s4s_build/src/s4s/vendor/github.com/gocelery/gocelery/worker.go:38 +0x99

I saw the code here

// special case - convert float64 to int if applicable
// this is due to json limitation where all numbers are converted to float64
if origType == reflect.Int && msgType == reflect.Float64 {
	arg = int(arg.(float64))
}

I was wondering if int64 type is considered

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

No branches or pull requests

1 participant