Home > Back-end >  Questions about Java timer task, this functionality with what technology?
Questions about Java timer task, this functionality with what technology?

Time:02-19

Before there is a demand is from Monday to Friday, 9 am to 6 PM call interface query online number, and then inserted into the database in this period, I did, I was using a task of spring, written by cron expression,
Now demand changed, wish execution time is no longer only Monday to Friday, because sometimes the holiday vacation, have someone work overtime on Saturday, also to perform this task, he does not perform the task of time (namely the holiday time, all written on the table), now hope there is no time on the database table to perform tasks regularly, weekend, of course, the default or not to perform, with what technology?

CodePudding user response:

You this kind of customized demand that clearly to write ah, haven't framework can know JiaRiBan holiday arrangements in advance...

CodePudding user response:

reference 1st floor maradona1984 response:
you this kind of customized demand that clearly to write ah, haven't framework can know JiaRiBan holiday arrangements in advance...

I never used before timing Task, is the last time he asked me to write the tasks every day, I am made of spring's Task, cron expression inside configuration file, demand has changed, now I don't know what to do, I mainly want to ask, what kind of technology is needed to do this? A Task or Quartz

CodePudding user response:

This may need to use a table to maintenance, the task of the periodic table

CodePudding user response:

The function general framework of the customization is certainly do not support, you have to understand the somebody else's boundary, the best solution is to use a table maintenance holidays, do this can be configured, because every year holiday arrangement is different, although there is a certain rule, performs the task of time every day to check whether this table need to perform tasks can regularly, don't need don't perform real statistical code.

Reference
demand has changed, now want to execute time is Monday to Friday only no longer, because sometimes the holiday vacation, have someone work overtime on Saturday, also to perform this task, he does not perform the task of time (namely the holiday time, all written on the table), now hope there is no time on the database table to perform tasks regularly, by default, of course, weekend or does not perform

Work from the point of this passage, assign you have plan for you, why do you ask? I suggest you to design the function of more people communicate more communication, you and he felt a little understanding of timing task border, he understand is statistical insert this logic, you understand is including timing rules, logic, your answer is in your description, just you don't understand.

CodePudding user response:

To answer the above, I think you in shorter time, estimates that will get me wrong, your timing task is configured to perform every day, rather than from Monday to Friday, whether the real business logic according to the table of time allocation to judge.

CodePudding user response:

reference 5 floor maradona1984 reply:
to the above, I think you in shorter time, estimated that will get me wrong, your timing task is configured to perform every day, rather than from Monday to Friday, whether to perform the real business logic according to the time table configuration to judge.

Is configured on Monday to Friday, I use the cron expression, but give me task, sometimes will work overtime at the weekend, or holiday accounted for any day Monday to Friday, if no one to work that day, it is not necessary to carry out tasks regularly, so he has built a holiday list and special constraints before I write the timer task

CodePudding user response:

Timer configured to perform every day, and then the code to check your configuration tables to deciding to execute the business logic

CodePudding user response:

reference is 6th floor into the wrong line response:
Quote: refer to the 5 floor maradona1984 response:
to the above, I think you in shorter time, estimated that will get me wrong, your timing task is configured to perform every day, rather than from Monday to Friday, whether to perform the real business logic according to the time table configuration to judge.

Is configured on Monday to Friday, I use the cron expression, but give me task, sometimes will work overtime at the weekend, or holiday accounted for any day Monday to Friday, if no one to work that day, it is not necessary to carry out tasks regularly, so he has built a holiday list and special constraints before I write the timer task

A bit difficult to communicate with you ha ~, you this idea a little dead, can you jump out of the job configuration to regularly, you this time configuration changes into everyday task execution, and then to check the holiday list today whether need to statistics, need to statistics, don't need don't statistics.
Above where I pointed out your problems, but what you are reading comprehension ability even it is hard to understand where is the key, I can only repeater tell you about the above solutions.
1. Modify the timing task allocation to perform every day.
2. Add a holiday list, timing task execution time, read the table, the day is a holiday, it does not perform on-line toll, the logic (the somebody else don't mean to not perform tasks regularly, statistical and insert, just don't go to your question is here, although I cannot understand your understanding of the problem will be stuck in here)
3. This holiday card how to design, probably just had a date
4. The other should be no need to modify the

And give you the task of people have said so, you haven't understand... Recommended to consult with him, try to be information is symmetrical, don't be afraid of losing face, do not to come out to lose face.

CodePudding user response:

reference is 6th floor into the wrong line response:
Quote: refer to the 5 floor maradona1984 response:
to the above, I think you in shorter time, estimated that will get me wrong, your timing task is configured to perform every day, rather than from Monday to Friday, whether to perform the real business logic according to the time table configuration to judge.

Is configured on Monday to Friday, I use the cron expression, but give me task, sometimes will work overtime at the weekend, or holiday accounted for any day Monday to Friday, if no one to work that day, it is not necessary to carry out tasks regularly, so he has built a holiday list and special constraints before I write the timer task

Meaning there is no need to perform tasks regularly refers to not to do "9 am to 6 PM call interface query online number" this matter, said the task of timing task, will not regular tasks to people don't care, since the configuration for the Monday to Friday is unable to meet demand and the framework provided didn't meet demand solutions, natural would be to implement, which is added a holiday list, you write code to determine whether need to query the number of online it.

Say to this, you also don't understand, that I really feel good about your id take, can consider to change a job, although have a little hurt, but everyone has a suitable for their own work, don't need to do is not suitable for their own work.

CodePudding user response:

references 9 f maradona1984 response:
Quote: refer to the sixth floor is into the wrong line response:
Quote: refer to the fifth floor maradona1984 reply:
to the above, I think you in shorter time, estimated that will get me wrong, your timing task is configured to perform every day, rather than from Monday to Friday, whether to perform the real business logic according to the time table configuration to judge.

Is configured on Monday to Friday, I use the cron expression, but give me task, sometimes will work overtime at the weekend, or holiday accounted for any day Monday to Friday, if no one to work that day, it is not necessary to carry out tasks regularly, so he has built a holiday list and special constraints before I write the timer task

Meaning there is no need to perform tasks regularly refers to not to do "9 am to 6 PM call interface query online number" this matter, said the task of timing task, will not regular tasks to people don't care, since the configuration for the Monday to Friday is unable to meet demand and the framework provided didn't meet demand solutions, natural would be to implement, which is added a holiday list, you write code to determine whether need to query the number of online it.

Say to this, you also don't understand, that I really feel good about your id take, can consider to change a job, although have a little hurt, but everyone has a suitable for their own work, don't need to do is not suitable for their own work.


Ok, change your job immediately,
1. I said a holiday table
Table 2. The holiday is operational in advance to write up the
3. You always give me your ideas, I took, you little simple logic I still understand, a began to ask questions when they understand
4. I'd like to ask is how to control in dynamic timing task
5. You always say I've always said time task, holiday table inside you let ops write every weekend? Only the date of the holidays or weekends, you might say: don't you judge this weekend? Hurry up to give Lao tze to work, ha ha
  • Related