mirror of
https://github.com/ManyakRus/starter.git
synced 2025-11-23 22:45:11 +02:00
сделал Round_Float64_WithPrecision()
This commit is contained in:
@@ -111,12 +111,11 @@ func Connect_err(Connection connections.Connection) error {
|
||||
}
|
||||
|
||||
mutex_Connect.Lock() //race
|
||||
defer mutex_Connect.Unlock()
|
||||
|
||||
MapConnection[Connection.ID] = Connection
|
||||
MapConn[Connection.ID] = Conn
|
||||
|
||||
mutex_Connect.Unlock()
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -252,12 +251,11 @@ func CloseConnection_err(Connection connections.Connection) error {
|
||||
Conn = nil
|
||||
|
||||
mutex_Connect.Lock() //race
|
||||
defer mutex_Connect.Unlock()
|
||||
|
||||
delete(MapConnection, Connection.ID)
|
||||
delete(MapConn, Connection.ID)
|
||||
|
||||
mutex_Connect.Unlock()
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -342,10 +340,6 @@ func GetConnection(Connection connections.Connection) *gorm.DB {
|
||||
mutex_Connect.RLock()
|
||||
defer mutex_Connect.RUnlock()
|
||||
|
||||
//мьютекс чтоб не подключаться одновременно
|
||||
mutex_Connect.RLock()
|
||||
defer mutex_Connect.RUnlock()
|
||||
|
||||
//
|
||||
Conn := MapConn[Connection.ID]
|
||||
if Conn == nil {
|
||||
|
||||
Reference in New Issue
Block a user