Removes and re-adds a database to the ServerContext.
(ctx context.Context, reloadDbName string, forceOnline bool)
| 562 | |
| 563 | // Removes and re-adds a database to the ServerContext. |
| 564 | func (sc *ServerContext) ReloadDatabase(ctx context.Context, reloadDbName string, forceOnline bool) (*db.DatabaseContext, error) { |
| 565 | // Obtain write lock during add database, to avoid race condition when creating based on ConfigServer |
| 566 | sc._databasesLock.Lock() |
| 567 | defer sc._databasesLock.Unlock() |
| 568 | return sc._reloadDatabase(ctx, reloadDbName, false, forceOnline) |
| 569 | } |
| 570 | |
| 571 | func (sc *ServerContext) ReloadDatabaseWithConfig(nonContextStruct base.NonCancellableContext, config DatabaseConfig) error { |
| 572 | sc._databasesLock.Lock() |