빈 디비에서 최소 실행할 때 문제 수정

This commit is contained in:
2023-06-21 17:56:27 +09:00
parent 3c9b959ad6
commit 9fd2316eeb

View File

@ -476,6 +476,14 @@ func (mg *Maingate) RegisterHandlers(ctx context.Context, serveMux *http.ServeMu
only.prepare(mg)
atomic.StorePointer(&mg.serviceptr, unsafe.Pointer(only))
} else {
empty := serviceDescription{
ServiceDescriptionSummary: ServiceDescriptionSummary{
Id: primitive.NewObjectID(),
},
}
empty.prepare(mg)
atomic.StorePointer(&mg.serviceptr, unsafe.Pointer(&empty))
}
logger.Println("Service is registered :", mg.service().ServiceCode)