MCPcopy
hub / github.com/apache/devlake / InitMigrator

Function InitMigrator

backend/core/runner/migration.go:33–43  ·  view source on GitHub ↗

InitMigrator a Migrator singleton

(basicRes context.BasicRes)

Source from the content-addressed store, hash-verified

31
32// InitMigrator a Migrator singleton
33func InitMigrator(basicRes context.BasicRes) (plugin.Migrator, errors.Error) {
34 lock.Lock()
35 defer lock.Unlock()
36
37 if migrator != nil {
38 return nil, errors.Internal.New("migrator singleton has already been initialized")
39 }
40 var err errors.Error
41 migrator, err = migration.NewMigrator(basicRes)
42 return migrator, err
43}
44
45// GetMigrator returns the shared Migrator singleton
46func GetMigrator() plugin.Migrator {

Callers 1

DirectRunFunction · 0.85

Calls 1

NewMethod · 0.65

Tested by

no test coverage detected