[GH-18504] Migrate from gorp to sqlx in store/sqlstore/file_info_store.go (#18637)
* Migrate from gorp to sqlx in store/sqlstore/file_info_store.go Signed-off-by: Igor German <germanenak@gmail.com> * Use separate structs for FileInfo Signed-off-by: Igor German <germanenak@gmail.com> * Fix CR comments Signed-off-by: Igor German <germanenak@gmail.com> Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
@@ -454,6 +454,22 @@ func (ss *SqlStore) GetSearchReplica() *gorp.DbMap {
|
||||
return ss.searchReplicas[rrNum]
|
||||
}
|
||||
|
||||
func (ss *SqlStore) GetSearchReplicaX() *sqlxDBWrapper {
|
||||
ss.licenseMutex.RLock()
|
||||
license := ss.license
|
||||
ss.licenseMutex.RUnlock()
|
||||
if license == nil {
|
||||
return ss.GetMasterX()
|
||||
}
|
||||
|
||||
if len(ss.settings.DataSourceSearchReplicas) == 0 {
|
||||
return ss.GetReplicaX()
|
||||
}
|
||||
|
||||
rrNum := atomic.AddInt64(&ss.srCounter, 1) % int64(len(ss.searchReplicaXs))
|
||||
return ss.searchReplicaXs[rrNum]
|
||||
}
|
||||
|
||||
func (ss *SqlStore) GetReplica() *gorp.DbMap {
|
||||
ss.licenseMutex.RLock()
|
||||
license := ss.license
|
||||
|
||||
Ссылка в новой задаче
Block a user