forked from TrueCloudLab/frostfs-contract
[#135] frostfsid: Make migration idempotent
Signed-off-by: Alexander Chuprov <a.chuprov@yadro.com>
This commit is contained in:
parent
762d7f9f9f
commit
01597b5dde
1 changed files with 3 additions and 1 deletions
|
@ -103,7 +103,8 @@ func _deploy(data any, isUpdate bool) {
|
||||||
ctx := storage.GetContext()
|
ctx := storage.GetContext()
|
||||||
|
|
||||||
args := data.(struct {
|
args := data.(struct {
|
||||||
admin interop.Hash160
|
admin interop.Hash160
|
||||||
|
version int
|
||||||
})
|
})
|
||||||
|
|
||||||
if args.admin != nil {
|
if args.admin != nil {
|
||||||
|
@ -114,6 +115,7 @@ func _deploy(data any, isUpdate bool) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if isUpdate {
|
if isUpdate {
|
||||||
|
common.CheckVersion(args.version)
|
||||||
it := storage.Find(ctx, subjectKeysPrefix, storage.ValuesOnly)
|
it := storage.Find(ctx, subjectKeysPrefix, storage.ValuesOnly)
|
||||||
for iterator.Next(it) {
|
for iterator.Next(it) {
|
||||||
subjectRaw := iterator.Value(it)
|
subjectRaw := iterator.Value(it)
|
||||||
|
|
Loading…
Reference in a new issue