Skip to content

Commit

Permalink
Remove nests
Browse files Browse the repository at this point in the history
  • Loading branch information
jfberry committed Apr 15, 2024
1 parent d28f823 commit d3cc114
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 142 deletions.
23 changes: 0 additions & 23 deletions db/nests.go

This file was deleted.

98 changes: 0 additions & 98 deletions decoder/nests.go

This file was deleted.

1 change: 0 additions & 1 deletion decoder/pokemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,6 @@ func savePokemonRecordAsAtTime(ctx context.Context, db db.DbDetails, pokemon *Po
areas := MatchStatsGeofence(pokemon.Lat, pokemon.Lon)
createPokemonWebhooks(ctx, db, oldPokemon, pokemon, areas)
updatePokemonStats(oldPokemon, pokemon, areas)
updatePokemonNests(oldPokemon, pokemon)

pokemon.Pvp = null.NewString("", false) // Reset PVP field to avoid keeping it in memory cache

Expand Down
10 changes: 1 addition & 9 deletions decoder/stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,6 @@ func StartStatsWriter(statsDb *sqlx.DB) {
}
}()

t3 := time.NewTicker(15 * time.Minute)
go func() {
for {
<-t3.C
logNestCount()
}
}()

t4 := time.NewTicker(10 * time.Minute)
go func() {
for {
Expand Down Expand Up @@ -440,7 +432,7 @@ func updateRaidStats(old *Gym, new *Gym, areas []geo.AreaName) {

// Check if Raid has started/is active or RaidEndTimestamp has changed (Back-to-back raids)
if new.RaidPokemonId.ValueOrZero() > 0 &&
(old == nil || old.RaidPokemonId != new.RaidPokemonId || old.RaidEndTimestamp != new.RaidEndTimestamp) {
(old == nil || old.RaidPokemonId != new.RaidPokemonId || old.RaidEndTimestamp != new.RaidEndTimestamp) {

if !locked {
raidStatsLock.Lock()
Expand Down
3 changes: 0 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ func main() {

decoder.InitialiseOhbem()
decoder.LoadStatsGeofences()
decoder.LoadNests(dbDetails)
InitDeviceCache()

wg.Add(1)
Expand Down Expand Up @@ -266,8 +265,6 @@ func main() {
apiGroup.GET("/pokestop/id/:fort_id", GetPokestop)
apiGroup.POST("/reload-geojson", ReloadGeojson)
apiGroup.GET("/reload-geojson", ReloadGeojson)
apiGroup.POST("/reload-nests", ReloadNests)
apiGroup.GET("/reload-nests", ReloadNests)

apiGroup.GET("/pokemon/id/:pokemon_id", PokemonOne)
apiGroup.GET("/pokemon/available", PokemonAvailable)
Expand Down
8 changes: 0 additions & 8 deletions routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,14 +347,6 @@ func ReloadGeojson(c *gin.Context) {
})
}

func ReloadNests(c *gin.Context) {
decoder.ReloadNestsAndClearStats(dbDetails)

c.JSON(http.StatusAccepted, map[string]interface{}{
"status": "ok",
})
}

func PokemonScan(c *gin.Context) {
var requestBody decoder.ApiPokemonScan

Expand Down

0 comments on commit d3cc114

Please sign in to comment.