1
0
mirror of https://github.com/ManyakRus/crud_generator.git synced 2024-12-22 00:36:41 +02:00

сделал mutex_GetVersionModel

This commit is contained in:
Nikitin Aleksandr 2024-01-23 16:20:10 +03:00
parent 6ec1421434
commit dc7df48dd7
2 changed files with 6 additions and 4 deletions

View File

@ -27,9 +27,10 @@ var mutex_GetVersionModel = sync.Mutex{}
// GetVersionModel - возвращает хэш версии структуры модели
func (crud Crud_GRPC) GetVersionModel() uint32 {
mutex_GetVersionModel.Lock()
defer mutex_GetVersionModel.Unlock()
if VersionModel == 0 {
mutex_GetVersionModel.Lock()
defer mutex_GetVersionModel.Unlock()
VersionModel = lawsuit_status_types.LawsuitStatusType{}.GetStructVersion()
}
return VersionModel

View File

@ -25,9 +25,10 @@ var mutex_GetVersionModel = sync.Mutex{}
// GetVersionModel - возвращает хэш версии структуры модели
func (crud Crud_NRPC) GetVersionModel() uint32 {
mutex_GetVersionModel.Lock()
defer mutex_GetVersionModel.Unlock()
if VersionModel == 0 {
mutex_GetVersionModel.Lock()
defer mutex_GetVersionModel.Unlock()
VersionModel = lawsuit_status_types.LawsuitStatusType{}.GetStructVersion()
}
return VersionModel