Comments (3)
I am thinking that in the actual project application scenario, our cron actually runs under multiple nodes.
I was wondering if I could provide an independent way to support the multi-node guarantee of single-node operation.
Through a distributed lock to ensure that only one of the multiple nodes can perform tasks?
If you use this scheme, you need to ensure that the time of multiple nodes is consistent.
Do you have a better plan? Look forward to further communication with you
from cron.
I am thinking that in the actual project application scenario, our cron actually runs under multiple nodes.我在想,在实际的项目应用场景中,我们的cron实际上是在多个节点下运行的。
I was wondering if I could provide an independent way to support the multi-node guarantee of single-node operation.我想知道我是否可以提供一种独立的方式来支持单节点操作的多节点保证。Through a distributed lock to ensure that only one of the multiple nodes can perform tasks?通过分布式锁来保证多个节点中只有一个可以执行任务? If you use this scheme, you need to ensure that the time of multiple nodes is consistent.如果使用此方案,则需要保证多个节点的时间一致。
Do you have a better plan? Look forward to further communication with you你有更好的计划吗?期待与您的进一步沟通
I wrote a Mutex
to implement a distributed single server to run. This is my implementation on go-kratos
.
https://github.com/go-kratos-ecosystem/components/tree/2.x/crontab
PS: I don't think it's optimal, there's room for improvement, but I haven't had time to think about it. If you have any better suggestions, I'd love to hear them.
from cron.
I am thinking that in the actual project application scenario, our cron actually runs under multiple nodes.
I was wondering if I could provide an independent way to support the multi-node guarantee of single-node operation.Through a distributed lock to ensure that only one of the multiple nodes can perform tasks? If you use this scheme, you need to ensure that the time of multiple nodes is consistent.
Do you have a better plan? Look forward to further communication with you你有更好的计划吗?期待与您进一步沟通
I implemented a package to solve this problem, the address of the package is: https://github.com/go-kratos-ecosystem/components/tree/2.x/crontab/jobwrapper/mutex
How to use it: https://github.com/go-kratos-ecosystem/components/blob/2.x/crontab/README.md
from cron.
Related Issues (20)
- When creating a new cron object, multiple construction methods are provided.
- provide ant way to change the value of Now for testing purposes HOT 1
- I cannot pass second as 6th param for cronjob HOT 2
- Troubles in docker
- crontab run error HOT 2
- does this package support standard crontab expr HOT 1
- Why is time zone not supported? this is exactly what i need HOT 1
- cron.New().Remove() HOT 1
- performance wise question
- During the execution process of scheduled tasks, a change in the system time can result in incorrect execution timing. HOT 2
- Tag 3.0.1 too old HOT 1
- How to start job from the past time?
- How to retrieve command
- Wrong Result on Sync Cron HOT 1
- Removing entry does not update the cron HOT 1
- cron expression failed to be parsed - unknown unit "d"
- How to schedule job to run on every 2nd thursday of month at 10:10 AM HOT 1
- Data Loss When Program Stops Running
- os time change HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cron.