Skip to content

Commit d876f21

Browse files
frncmxzelig
authored andcommitted
swarm/storage: move 'running migrations for' log line (#18120)
So that we only see the log message when we actually have to migrate.
1 parent 7bf7bd2 commit d876f21

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

swarm/storage/localstore.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,20 +194,21 @@ func (ls *LocalStore) Close() {
194194
ls.DbStore.Close()
195195
}
196196

197-
// Migrate checks the datastore schema vs the runtime schema, and runs migrations if they don't match
197+
// Migrate checks the datastore schema vs the runtime schema and runs
198+
// migrations if they don't match
198199
func (ls *LocalStore) Migrate() error {
199200
actualDbSchema, err := ls.DbStore.GetSchema()
200201
if err != nil {
201202
log.Error(err.Error())
202203
return err
203204
}
204205

205-
log.Debug("running migrations for", "schema", actualDbSchema, "runtime-schema", CurrentDbSchema)
206-
207206
if actualDbSchema == CurrentDbSchema {
208207
return nil
209208
}
210209

210+
log.Debug("running migrations for", "schema", actualDbSchema, "runtime-schema", CurrentDbSchema)
211+
211212
if actualDbSchema == DbSchemaNone {
212213
ls.migrateFromNoneToPurity()
213214
actualDbSchema = DbSchemaPurity

0 commit comments

Comments
 (0)