Closes: FRMW-2892, FRMW-2893
**What**
Wired up the building block that we merged previously in order to manage data synchronization. The flow is as follow
- On application start
- Build schema object representation from configuration
- Check configuration changes
- if new entities configured
- Data synchronizer initialize orchestrator and start sync
- for each entity
- acquire lock
- mark existing data as staled
- sync all data by batch
- marked them not staled anymore
- acknowledge each processed batch and renew lock
- update metadata with last synced cursor for entity X
- release lock
- remove all remaining staled data
- if any entities removed from last configuration
- remove the index data and relations
Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com>
16 lines
408 B
TypeScript
16 lines
408 B
TypeScript
export const updateRemovedSchema = `
|
|
type Product @Listeners(values: ["product.created", "product.updated", "product.deleted"]) {
|
|
id: String
|
|
title: String
|
|
handle: String
|
|
variants: [ProductVariant]
|
|
}
|
|
|
|
type ProductVariant @Listeners(values: ["variant.created", "variant.updated", "variant.deleted"]) {
|
|
id: String
|
|
product_id: String
|
|
sku: String
|
|
description: String
|
|
}
|
|
`
|