1
0
Fork 0
mirror of https://github.com/anyproto/anytype-heart.git synced 2025-06-09 17:44:59 +09:00

Update to latest any-sync

This commit is contained in:
mcrakhman 2023-04-25 18:17:59 +02:00 committed by Mikhail Iudin
parent 5e57cec391
commit 97816c7a3a
No known key found for this signature in database
GPG key ID: FAAAA8BAABDFF1C0
5 changed files with 12 additions and 17 deletions

View file

@ -71,7 +71,7 @@ func (z *zipTreeReadStorage) AddRawChange(change *treechangeproto.RawTreeChangeW
panic("should not be called")
}
func (z *zipTreeReadStorage) TransactionAdd(changes []*treechangeproto.RawTreeChangeWithId, heads []string) (err error) {
func (z *zipTreeReadStorage) AddRawChangesSetHeads(changes []*treechangeproto.RawTreeChangeWithId, heads []string) (err error) {
panic("should not be called")
}

View file

@ -63,7 +63,7 @@ func (z *zipTreeWriteStorage) AddRawChange(change *treechangeproto.RawTreeChange
return
}
func (z *zipTreeWriteStorage) TransactionAdd(changes []*treechangeproto.RawTreeChangeWithId, heads []string) (err error) {
func (z *zipTreeWriteStorage) AddRawChangesSetHeads(changes []*treechangeproto.RawTreeChangeWithId, heads []string) (err error) {
for _, ch := range changes {
err = z.AddRawChange(ch)
if err != nil {

3
go.mod
View file

@ -7,7 +7,7 @@ require (
github.com/PuerkitoBio/goquery v1.8.1
github.com/VividCortex/ewma v1.2.0
github.com/adrium/goheif v0.0.0-20230113233934-ca402e77a786
github.com/anytypeio/any-sync v0.0.44
github.com/anytypeio/any-sync v0.0.45
github.com/anytypeio/go-naturaldate/v2 v2.0.1
github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de
github.com/blevesearch/bleve/v2 v2.3.6
@ -89,7 +89,6 @@ require (
go.uber.org/zap v1.24.0
golang.org/x/exp v0.0.0-20230420155640-133eef4313cb
golang.org/x/image v0.6.0
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028
golang.org/x/net v0.10.0
golang.org/x/oauth2 v0.5.0
golang.org/x/text v0.9.0

5
go.sum
View file

@ -42,8 +42,8 @@ github.com/andybalholm/cascadia v1.2.0/go.mod h1:YCyR8vOZT9aZ1CHEd8ap0gMVm2aFgxB
github.com/andybalholm/cascadia v1.3.1 h1:nhxRkql1kdYCc8Snf7D5/D3spOX+dBgjA6u8x004T2c=
github.com/andybalholm/cascadia v1.3.1/go.mod h1:R4bJ1UQfqADjvDa4P6HZHLh/3OxWWEqc0Sk8XGwHqvA=
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
github.com/anytypeio/any-sync v0.0.44 h1:D2XxcI3otJzA50dwtTZM+yWwZqeZVSDLdW1JZSViTfs=
github.com/anytypeio/any-sync v0.0.44/go.mod h1:LK/bCkCHLK3l8b0Bp3MpAD1sIUvJe0vwJNonBqiegsA=
github.com/anytypeio/any-sync v0.0.45 h1:I6/i0SGCDnKwRVn0PpXtGsp5nRkODtFp6BXKUBodAPQ=
github.com/anytypeio/any-sync v0.0.45/go.mod h1:LK/bCkCHLK3l8b0Bp3MpAD1sIUvJe0vwJNonBqiegsA=
github.com/anytypeio/go-chash v0.1.0 h1:nYCMh13SEai/7cXRUoKfU27uASj7XEF6NhvY6hFMKY8=
github.com/anytypeio/go-chash v0.1.0/go.mod h1:Q7XiggkMrThRFAwYSItzLOT9OPC8a497SLZtgmJtC/I=
github.com/anytypeio/go-ds-badger3 v0.3.1-0.20221103102622-3233d4e13cb8 h1:LC9w0M0SbA5VuZeBtUdq+uR4mdjbJhxurNtovmRiOrU=
@ -1029,7 +1029,6 @@ golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvx
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028 h1:4+4C/Iv2U4fMZBiMCc98MG1In4gJY5YRhtpDNeDeHWs=
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=

View file

@ -117,17 +117,14 @@ func (t *treeStorage) AddRawChange(change *treechangeproto.RawTreeChangeWithId)
return putDB(t.db, t.keys.RawChangeKey(change.Id), change.RawChange)
}
func (t *treeStorage) TransactionAdd(changes []*treechangeproto.RawTreeChangeWithId, heads []string) error {
return t.db.Update(func(txn *badger.Txn) error {
for _, ch := range changes {
err := txn.Set(t.keys.RawChangeKey(ch.Id), ch.RawChange)
if err != nil {
return err
}
func (t *treeStorage) AddRawChangesSetHeads(changes []*treechangeproto.RawTreeChangeWithId, heads []string) error {
for _, ch := range changes {
err := t.AddRawChange(ch)
if err != nil {
return err
}
payload := treestorage.CreateHeadsPayload(heads)
return txn.Set(t.keys.HeadsKey(), payload)
})
}
return t.SetHeads(heads)
}
func (t *treeStorage) GetRawChange(ctx context.Context, id string) (raw *treechangeproto.RawTreeChangeWithId, err error) {