Skip to content

Commit

Permalink
feat: cleanup db
Browse files Browse the repository at this point in the history
  • Loading branch information
Angular2Guy committed Mar 27, 2024
1 parent bbc030e commit 7880c4c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions backend/pkd/gasstation/gsrepo.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,10 @@ func calcCountyTimeSlots() {
myStart := time.Now()
postCodePostCodeLocationMap, _, idCountyDataMap, postCodeGasStationsMap := createPostCodeGasStationMaps()
postCodeTimeSliceBuckets := createCodeTimeSliceBuckets(postCodePostCodeLocationMap, postCodeGasStationsMap)
database.DB.Transaction(func(tx *gorm.DB) error {
tx.Delete(&pcmodel.CountyTimeSlot{})
return nil
})
//TODO calc average changes in 10 min slots
for _, myCountyData := range idCountyDataMap {
//10 min buckets
Expand Down

0 comments on commit 7880c4c

Please sign in to comment.