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

任务分组功能 #16

Open
alanchen78 opened this issue Oct 18, 2022 · 2 comments
Open

任务分组功能 #16

alanchen78 opened this issue Oct 18, 2022 · 2 comments

Comments

@alanchen78
Copy link

关于任务分组功能,不知道如何扩展实现。或是能不能计划在下一个版本中加入?
为每个任务分配一个分组标识。任务初始化和起动时,只初始化和起动对应分组的标识的任务。
这样在任务特别多时,就可以用多个服务器根据分组进行分摊运行。有点像分布式?

在没有这功能前,我是想把标识写在 task.body里。
但不知道下面这个初始化,如何只查询调用 task.body 包含特别标识的任务。
_scheduler = new Scheduler(new MyTaskHandler(_fsql), new MyCustomTaskHandler());

@2881099
Copy link
Owner

2881099 commented Oct 18, 2022

fsql FuentApi 可以设置 TaskInfo 映射的表名。

A 程序 fsql.CodrFirst.ConfigEntity<TaskInfo>(t=> t.Name("fscheduler_a"))

B 程序 fsql.CodrFirst.ConfigEntity<TaskInfo>(t=> t.Name("fscheduler_b"))

@alanchen78
Copy link
Author

赞。是个好办法。
我现在是把所有任务加载了,再把不是这个分组的再remove了。

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

2 participants