Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
215fcb2
Webhooks to structures
jfberry Jan 25, 2026
f8b2eb1
Replace per-pokemon goroutines with pending queue
jfberry Jan 11, 2026
22afd74
Remove comment
jfberry Jan 28, 2026
3de2ece
Example dirty flag implementation
jfberry Jan 26, 2026
d238589
Update pokemon and gym to use new pattern
jfberry Jan 28, 2026
80e1826
Update isNewRecord logic
jfberry Jan 28, 2026
8226a5f
Merge branch 'json_structure' into dirtyflag_prototype
jfberry Jan 28, 2026
c502d6d
Merge remote-tracking branch 'origin/feature/pokemon-pending-queue' i…
jfberry Jan 28, 2026
2b5b7fb
Additional types converted to new model
jfberry Jan 28, 2026
a985123
Generic sharding introduced for pokestop/gym
jfberry Jan 28, 2026
bb8210c
Database change tracing
jfberry Jan 28, 2026
33e6e2e
Add to cache on get
jfberry Jan 28, 2026
7db7d36
Add to cache on get incident
jfberry Jan 28, 2026
af8b3ef
Add weather to cache on read
jfberry Jan 29, 2026
f89eab3
copilot comments
jfberry Jan 30, 2026
f4b3714
switch to internal pokemon lock
jfberry Jan 30, 2026
9660a71
optimise locking in getOrCreatePokemonRecord
jfberry Jan 30, 2026
9e24751
optimise locking in getOrCreatePokemonRecord
jfberry Jan 30, 2026
ca4f0d6
optimise locking in getOrCreatePokemonRecord
jfberry Jan 30, 2026
0825445
Pokestop to new locking model
jfberry Jan 30, 2026
642eb32
Gym locking model changes
jfberry Jan 30, 2026
c56b3ba
copilot review suggestion fixes
jfberry Jan 30, 2026
a28a039
update modules
jfberry Jan 30, 2026
03c897a
fix: increase spawnpoint updates
Fabio1988 Jan 29, 2026
d2ba3b7
feat: reduce updates config
Fabio1988 Jan 30, 2026
0a3cee9
Merge pull request #334 from UnownHash/db_update_frequ
jfberry Jan 30, 2026
f4976ac
more locking update
jfberry Jan 30, 2026
0f2bd79
spawnpoint locking
jfberry Jan 30, 2026
07efbe6
Tidy source
jfberry Jan 31, 2026
58c22db
Remove json fields, these should not be directly serialised
jfberry Jan 31, 2026
b69b5ac
Claude review items
jfberry Jan 31, 2026
1452c1f
Move config options into tuning
jfberry Feb 1, 2026
edf6d76
Some fields weren't being updated through SetXX
jfberry Feb 1, 2026
140e36a
Improved dbupdate logging to show before/after
jfberry Feb 1, 2026
ba42ef9
Ability to turn off nearby cell pokemon
jfberry Feb 1, 2026
dba646a
API documentation
jfberry Feb 1, 2026
c02ade8
Change null debug output so it is more readable
jfberry Feb 2, 2026
0382c1d
fix location of reduce_updates
jfberry Feb 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
760 changes: 760 additions & 0 deletions api.md

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions config.toml.example
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ stats_days = 7 # Remove entries from "pokemon_stats", "pokemon_
device_hours = 24 # Remove devices from in memory after not seen for x hours
forts_stale_threshold = 3600 # Seconds before a fort is considered stale (default: 1 hour)

[tuning]
# When enabled, reduce_updates will make fort update debounce windows much longer
# to reduce database churn. Specifically, gym/pokestop/station debounce will be
# extended from 15 minutes (900s) to 12 hours (43200s) and spawnpoint last_seen
# will be updated every 12 hours instead of the default 6 hours.
reduce_updates = false


[logging]
debug = false
save_logs = true
Expand Down
50 changes: 26 additions & 24 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,25 @@ import (
)

type configDefinition struct {
Port int `koanf:"port"`
GrpcPort int `koanf:"grpc_port"`
Webhooks []Webhook `koanf:"webhooks"`
Database database `koanf:"database"`
Logging logging `koanf:"logging"`
Sentry sentry `koanf:"sentry"`
Pyroscope pyroscope `koanf:"pyroscope"`
Prometheus Prometheus `koanf:"prometheus"`
PokemonMemoryOnly bool `koanf:"pokemon_memory_only"`
PokemonInternalToDb bool `koanf:"pokemon_internal_to_db"`
TestFortInMemory bool `koanf:"test_fort_in_memory"`
Cleanup cleanup `koanf:"cleanup"`
RawBearer string `koanf:"raw_bearer"`
ApiSecret string `koanf:"api_secret"`
Pvp pvp `koanf:"pvp"`
Koji koji `koanf:"koji"`
Tuning tuning `koanf:"tuning"`
Weather weather `koanf:"weather"`
ScanRules []scanRule `koanf:"scan_rules"`
MaxConcurrentProactiveIVSwitch int `koanf:"max_concurrent_proactive_iv_switch"`
Port int `koanf:"port"`
GrpcPort int `koanf:"grpc_port"`
Webhooks []Webhook `koanf:"webhooks"`
Database database `koanf:"database"`
Logging logging `koanf:"logging"`
Sentry sentry `koanf:"sentry"`
Pyroscope pyroscope `koanf:"pyroscope"`
Prometheus Prometheus `koanf:"prometheus"`
PokemonMemoryOnly bool `koanf:"pokemon_memory_only"`
PokemonInternalToDb bool `koanf:"pokemon_internal_to_db"`
TestFortInMemory bool `koanf:"test_fort_in_memory"`
Cleanup cleanup `koanf:"cleanup"`
RawBearer string `koanf:"raw_bearer"`
ApiSecret string `koanf:"api_secret"`
Pvp pvp `koanf:"pvp"`
Koji koji `koanf:"koji"`
Tuning tuning `koanf:"tuning"`
Weather weather `koanf:"weather"`
ScanRules []scanRule `koanf:"scan_rules"`
}

func (configDefinition configDefinition) GetWebhookInterval() time.Duration {
Expand Down Expand Up @@ -120,10 +119,12 @@ type database struct {
}

type tuning struct {
ExtendedTimeout bool `koanf:"extended_timeout"`
MaxPokemonResults int `koanf:"max_pokemon_results"`
MaxPokemonDistance float64 `koanf:"max_pokemon_distance"`
ProfileRoutes bool `koanf:"profile_routes"`
ExtendedTimeout bool `koanf:"extended_timeout"`
MaxPokemonResults int `koanf:"max_pokemon_results"`
MaxPokemonDistance float64 `koanf:"max_pokemon_distance"`
ProfileRoutes bool `koanf:"profile_routes"`
MaxConcurrentProactiveIVSwitch int `koanf:"max_concurrent_proactive_iv_switch"`
ReduceUpdates bool `koanf:"reduce_updates"`
}

type scanRule struct {
Expand All @@ -133,6 +134,7 @@ type scanRule struct {
ProcessPokemon *bool `koanf:"pokemon"`
ProcessWilds *bool `koanf:"wild_pokemon"`
ProcessNearby *bool `koanf:"nearby_pokemon"`
ProcessNearbyCell *bool `koanf:"nearby_cell_pokemon"`
ProcessWeather *bool `koanf:"weather"`
ProcessCells *bool `koanf:"cells"`
ProcessPokestops *bool `koanf:"pokestops"`
Expand Down
7 changes: 4 additions & 3 deletions config/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,10 @@ func ReadConfig() (configDefinition, error) {
MaxPool: 100,
},
Tuning: tuning{
MaxPokemonResults: 3000,
MaxPokemonDistance: 100,
MaxPokemonResults: 3000,
MaxPokemonDistance: 100,
MaxConcurrentProactiveIVSwitch: 6,
ReduceUpdates: false,
},
Weather: weather{
ProactiveIVSwitching: true,
Expand All @@ -61,7 +63,6 @@ func ReadConfig() (configDefinition, error) {
Pvp: pvp{
LevelCaps: []int{50, 51},
},
MaxConcurrentProactiveIVSwitch: 6,
}, "koanf"), nil)
if defaultErr != nil {
fmt.Println(fmt.Errorf("failed to load default config: %w", defaultErr))
Expand Down
Loading