Comments (3)
try getting settings in the task and not in the ctor
from abp.
try getting settings in the task and not in the ctor
tried but all fail. for example AsyncHelper , Task ,
I think it's better to have a async methord to init the backgroundworker,not in the constructor.
from abp.
solve by strange way
in order to start define settings before worker start, change AutoRegister to false. and start in postapplication event.
in order to execute async methord , config schedule job to flowing
`
public OrderExpCheckerWorker(ISettingManager settingManager, IOrderRepository orderRepository, IServiceProvider serviceProvider) : base()
{
_settingManager = settingManager;
_orderRepository = orderRepository;
_serviceProvider = serviceProvider;
AutoRegister = false;
JobDetail = JobBuilder.Create<OrderExpCheckerWorker>().WithIdentity(nameof(OrderExpCheckerWorker)).Build();
Trigger = TriggerBuilder.Create()
.WithIdentity(nameof(OrderExpCheckerWorker))
.Build();
ScheduleJob = async scheduler =>
{
if (!await scheduler.CheckExists(JobDetail.Key))
{
var p = await _settingManager.GetOrNullGlobalAsync(EShopConsts.OrderExpireCheckPeriodSetting);
Trigger = TriggerBuilder.Create()
.WithIdentity(nameof(OrderExpCheckerWorker))
.WithSimpleSchedule(s => s.WithIntervalInMinutes(Convert.ToInt32(p))
.RepeatForever()
.WithMisfireHandlingInstructionIgnoreMisfires()
)
.Build();
await scheduler.ScheduleJob(JobDetail, Trigger);
}
};
}
`
another way is change Trigger before manual start
from abp.
Related Issues (20)
- Add CorrelationId to Logger property for LogContext
- Volo.Abp.FluentValidation Package seems to not be working HOT 3
- Blazor webapp language switch error HOT 2
- Update angular packages version to `17.3.0`
- Cannot get value in AppSettings on the default page of AbpFramework, such as in Login.cshtml.cs HOT 1
- Optimize EntityChange logs HOT 2
- No project found in the directory when run abp install-libs HOT 2
- Send Base64 Images in Email with Google Apps
- Send Base64 Images in Email with Google Apps
- About Inline localization in template engines HOT 1
- can only be serialized using async serialization methods. HOT 4
- GetIdentityUsersInput recommends inheriting an extended property HOT 1
- identity module replaces PagedAndSortedResultRequestDto with ExtensiblePagedAndSortedResultRequestDto
- HTTP PUT & HTTP DELETE request not working on hosted application on IIS HOT 5
- Hangfire Dashboard Authorization isn't working HOT 1
- Blazorise licence in ABPFramework HOT 10
- 23:36:09 ERR] The required antiforgery header value "RequestVerificationToken" is not present. HOT 6
- Unhandled exception. Microsoft.Data.SqlClient.SqlException (0x80131904): Invalid collation 'ascii_general_ci'. HOT 7
- Why ConcurrencyStamp not change when ValueObject updated HOT 1
- Create blazor `global js&css` at runtime.
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 abp.