Skip to content

Commit

Permalink
Merge pull request #1260 from memphisdev/create_old_station_bug_fix
Browse files Browse the repository at this point in the history
fixed creation of unnecessary stream
  • Loading branch information
daniel-davidd authored Aug 17, 2023
2 parents b58f3f6 + c8bc0ba commit c79743f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/memphis_handlers_stations.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,15 +232,15 @@ func (s *Server) createStationDirectIntern(c *client,
csr.TenantName = t.Name
}

exist, station, err := db.GetStationByName(stationName.Ext(), csr.TenantName)
exist, _, err := db.GetStationByName(stationName.Ext(), csr.TenantName)
if err != nil {
serv.Errorf("[tenant: %v][user:%v]createStationDirect at db.GetStationByName: Station %v: %v", csr.TenantName, csr.Username, csr.StationName, err.Error())
jsApiResp.Error = NewJSStreamCreateError(err)
respondWithErrOrJsApiRespWithEcho(!isNative, c, memphisGlobalAcc, _EMPTY_, reply, _EMPTY_, jsApiResp, err)
return
}

if exist && ((csr.PartitionsNumber == 0 && len(station.PartitionsList) == 0) || (csr.PartitionsNumber > 0 && len(station.PartitionsList) > 0)) {
if exist {
jsApiResp.Error = NewJSStreamNameExistError()
respondWithErrOrJsApiRespWithEcho(!isNative, c, memphisGlobalAcc, _EMPTY_, reply, _EMPTY_, jsApiResp, err)
return
Expand Down

0 comments on commit c79743f

Please sign in to comment.