alex023 / clock Goto Github PK
View Code? Open in Web Editor NEWA low consumption, low latency support for frequent updates of large capcity timing manage
License: Apache License 2.0
A low consumption, low latency support for frequent updates of large capcity timing manage
License: Apache License 2.0
clock version:0.7
panic: send on closed channel
goroutine 27 [running]:
gitlab/service/timer.(*jobItem).action(0xc4202f10a0, 0xc4201aaa01)
/home/gofile/src/service/timer/job.go:57 +0x94
gitlab/service/timer.(*Clock).schedule(0xc420234510)
/home/gofile/src/service/timer/clock.go:132 +0x205
created by gitlab/service/timer.(*Clock).start
/home/gofile/src/service/timer/clock.go:85 +0xff
panic: runtime error: index out of range [recovered]
panic: runtime error: index out of range
goroutine 2078 [running]:
gitlab.**/service/timer.(*jobItem).call.func1()
/home/gofile/src/service/timer/job.go:65 +0x52
panic(0xc306c0, 0x11eefb0)
/usr/local/go/src/runtime/panic.go:489 +0x2cf
thanks!!!
如题
你好,我现在是将所有任务放在一个单例当中,但是当服务器挂了或者重启后,单例中任务都会消失,这种情况应该怎么处理呢?
panic: send on closed channel
goroutine 39 [running]:
gitlab.**/timer.(*jobItem).action(0xc424d59960, 0xc4201ae801)
/home/gofile/src/service/timer/job.go:57 +0x99
/home/gofile/src/service/timer.(*Clock).schedule(0xc420237e30)
/home/gofile/src/service/timer/clock.go:129 +0x205
created by /home/gofile/src/service/timer.(*Clock).start
/home/gofile/src/service/timer/clock.go:85 +0x111
I used the old version, the specific version number can not remember
thanks!!!
C:\Go\src\github.com\alex023\clock>go test
--- FAIL: TestClock_Create (0.00s)
panic: runtime error: invalid memory address or nil pointer dereference [recover
ed]
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x0 pc=0x4012ab]
goroutine 5 [running]:
testing.tRunner.func1(0x11978090)
C:/Go/src/testing/testing.go:711 +0x283
panic(0x506e20, 0x5beb18)
C:/Go/src/runtime/panic.go:491 +0x1d0
sync/atomic.LoadUint64(0x1195e0a4, 0x1195e090, 0x5d41e0)
C:/Go/src/sync/atomic/asm_386.s:159 +0xb
github.com/alex023/clock.(*Clock).WaitJobs(0x1195e090, 0x1195e090, 0xfa7b4a21)
C:/Go/src/github.com/alex023/clock/clock.go:307 +0x26
github.com/alex023/clock.TestClock_Create(0x11978090)
C:/Go/src/github.com/alex023/clock/clock_test.go:33 +0x33
testing.tRunner(0x11978090, 0x52b240)
C:/Go/src/testing/testing.go:746 +0xa6
created by testing.(*T).Run
C:/Go/src/testing/testing.go:789 +0x251
exit status 2
FAIL github.com/alex023/clock 0.046s
或者 如何传递 参数 比较好呢?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.