Skip to main content

Background Jobs & Queues

Booking Service

Jobหน้าที่Interval / behavior
BookingExpirationBackgroundServiceหา booking หมดเวลาชำระเงิน, set booking/info เป็น Expired, ส่ง email, notify Payment Service ผ่าน gRPCตาม BookingExpirationOptions.CheckIntervalSeconds
EmailQueueBackgroundServiceอ่าน EmailQueues และส่งผ่าน SendGridloop ตาม CheckIntervalSeconds ใน service
CarSyncQueueConsumerBackgroundServiceconsume car sync จาก Azure Queue แล้ว upsert snapshot ใน Booking DBpoll ทุก 5 วินาที, error delay 30 วินาที
BranchSyncQueueConsumerBackgroundServiceconsume branch syncpoll ทุก 5 วินาที
AddOnSyncQueueConsumerBackgroundServiceconsume add-on syncpoll ทุก 5 วินาที
CustomerSyncQueueConsumerBackgroundServiceconsume customer syncpoll ทุก 5 วินาที
UserSyncQueueConsumerBackgroundServiceconsume user syncpoll ทุก 5 วินาที

Queue consumers ใช้ Azure Queue และมี poison queue เมื่อ DequeueCount > 5

Catalog Service

Jobหน้าที่
CarProUnifiedSyncBackgroundServicesync branch/car/add-on จาก CarPro ตาม schedule
UserSyncQueueConsumerBackgroundServiceconsume user sync จาก Azure Queue ลง Catalog DB

Payment Service

Jobหน้าที่
CustomerSyncQueueConsumerconsume customer sync ลง Payment DB

Sync data ownership

DataSourceConsumers
UserUser ServiceBooking, Catalog
CustomerUser ServiceBooking, Payment
Car / Branch / Add-onCatalog Service / CarPro syncBooking