Cron kev qhia yog dab tsi nyob rau lub caij nplooj ntoos hlav?
Cron kev qhia yog dab tsi nyob rau lub caij nplooj ntoos hlav?

Video: Cron kev qhia yog dab tsi nyob rau lub caij nplooj ntoos hlav?

Video: Cron kev qhia yog dab tsi nyob rau lub caij nplooj ntoos hlav?
Video: Qhia txhais 50 zaj npau suav tias yog dab tsi part 3 15 Sep 2019 2024, Hlis ntuj nqeg
Anonim

A Cron kev qhia suav nrog rau qhov sib luag - thib ob, feeb, teev, hnub ntawm lub hli, hli, hnub (s) ntawm lub lis piam.and tau tshaj tawm raws li hauv qab no @Scheduled( cron = "* * * * **")

Kuj kom paub yog, dab tsi yog qhov kev qhia cron?

A CRON kev qhia yog ib txoj hlua ntawm 6 lossis 7 teb, sib cais los ntawm qhov chaw dawb, uas sawv cev rau lub sijhawm. A CRONexpression siv cov qauv hauv qab no (xyoo yog xaiv tau): Yog tias koj hloov lub sijhawm teev rau 6, 0 0 6 * * *, koj cov hlua sawv cev txhua hnub thaum 6:00 AM.

Cron qhia dab tsi hauv Java? A Cron Expressions Cron nthuav qhia yog siv los teeb tsa qhov piv txwv ntawm CronTrigger, subclass ntawm org.quartz. Trigger. A cronexpression yog ib txoj hlua uas muaj rau los yog xyasubexpressions (thaj chaw) uas piav qhia txog tus kheej cov ntsiab lus ntawm lub sijhawm.

Hauv qhov no, cron txoj hauj lwm nyob rau lub caij nplooj ntoos hlav yog dab tsi?

Caij nplooj ntoos hlav @Scheduled – 4 Txoj kev mus teem sijhawm Cov hauj lwm . Caij nplooj ntoos hlav muab kev txhawb nqa zoo rau ob leeg txoj hauj lwm teem sijhawm thiab asynchronous txoj kev ua raws li cron qhia siv @Scheduled annotation. Lub @Scheduledannotation tuaj yeem ntxiv rau ib txoj hauv kev nrog rau triggermetadata.

Lub caij nplooj ntoos hlav Schedule yog dab tsi?

Teem sijhawm yog ib txheej txheem ntawm kev ua cov haujlwm rau lub sijhawm tshwj xeeb. Caij nplooj ntoos hlav Boot muab kev txhawb nqa zoo sau a tus teem sijhawm ntawm Caij nplooj ntoos hlav daim ntawv thov.

Pom zoo: