1
0
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:
Nikitin Aleksandr
2025-06-02 16:42:10 +03:00
parent a1499f9a73
commit c4e7c84042
2 changed files with 3 additions and 10 deletions

View File

@@ -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 {

View File

@@ -389,6 +389,7 @@ func (s *memorySession) StoreSession(ctx context.Context, data []byte) error {
}
s.mux.Lock()
defer s.mux.Unlock()
//s.data = data
// write the whole body at once
@@ -397,8 +398,6 @@ func (s *memorySession) StoreSession(ctx context.Context, data []byte) error {
panic(err)
}
s.mux.Unlock()
return nil
}