Skip to content

Commit 50f2141

Browse files
committed
fix: improve mem usage
1 parent 5ce6f7e commit 50f2141

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

backend/pkd/gasstation/gsrepo.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,11 @@ func UpdatePrice(gasStationPrices *[]GasStationPrices) {
124124
delete(stationPricesMap, value.GasStationID)
125125
}
126126
}
127+
stationPricesDb = nil
128+
handleMaps(stationPricesMap, gasPriceUpdateMap)
129+
}
130+
131+
func handleMaps(stationPricesMap map[string]GasStationPrices, gasPriceUpdateMap map[string]gsmodel.GasPrice) {
127132
if len(stationPricesMap) > 0 {
128133
var stationIds []string
129134
for _, stationPrice := range stationPricesMap {

0 commit comments

Comments
 (0)