Skip to content

Commit d6bd8df

Browse files
committed
update
1 parent e204582 commit d6bd8df

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

pkg/datastore/datastore_rpc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ func (d *Datastore) Sync(ctx context.Context) {
275275
}
276276

277277
func (d *Datastore) writeToSyncTreeCandidate(ctx context.Context, updates []*sdcpb.Update, ts int64) error {
278-
upds, err := treetypes.ExpandAndConvertIntent(ctx, d.schemaClient, tree.RunningIntentName, tree.RunningValuesPrio, updates)
278+
upds, err := treetypes.ExpandAndConvertIntent(ctx, d.schemaClient, tree.RunningIntentName, tree.RunningValuesPrio, updates, ts)
279279
if err != nil {
280280
return err
281281
}

pkg/datastore/transaction_rpc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func (d *Datastore) SdcpbTransactionIntentToInternalTI(ctx context.Context, req
4040
}
4141

4242
// convert the sdcpb.updates to tree.UpdateSlice
43-
Updates, err := treetypes.ExpandAndConvertIntent(ctx, d.schemaClient, req.GetIntent(), req.GetPriority(), req.GetUpdate())
43+
Updates, err := treetypes.ExpandAndConvertIntent(ctx, d.schemaClient, req.GetIntent(), req.GetPriority(), req.GetUpdate(), time.Now().Unix())
4444
if err != nil {
4545
return nil, err
4646
}

pkg/tree/types/update.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ func (u *Update) GetPathSlice() PathSlice {
9595
}
9696

9797
// ExpandAndConvertIntent takes a slice of Updates ([]*sdcpb.Update) and converts it into a tree.UpdateSlice, that contains *treetypes.Updates.
98-
func ExpandAndConvertIntent(ctx context.Context, scb utils.SchemaClientBound, intentName string, priority int32, upds []*sdcpb.Update) (UpdateSlice, error) {
98+
func ExpandAndConvertIntent(ctx context.Context, scb utils.SchemaClientBound, intentName string, priority int32, upds []*sdcpb.Update, ts int64) (UpdateSlice, error) {
9999
converter := utils.NewConverter(scb)
100100

101101
// list of updates to be added to the cache
@@ -115,7 +115,7 @@ func ExpandAndConvertIntent(ctx context.Context, scb utils.SchemaClientBound, in
115115
}
116116

117117
// construct the cache.Update
118-
newCacheUpdates = append(newCacheUpdates, NewUpdate(pathslice, u.GetValue(), priority, intentName, 0))
118+
newCacheUpdates = append(newCacheUpdates, NewUpdate(pathslice, u.GetValue(), priority, intentName, ts))
119119
}
120120
return newCacheUpdates, nil
121121
}

0 commit comments

Comments
 (0)