modrzew / pokeminer

Pokemon location scraper
MIT License
220 stars 62 forks source link

gyms aren't updated. #179

Open vDrag0n opened 8 years ago

vDrag0n commented 8 years ago

Is this behavior expected? I don't see anywhere in the code where gyms are updated.

vanwinkelseppe commented 8 years ago

There was an issue with the api, while getting the map_objects. PGOAPI#47

Aiyubi commented 8 years ago

if you are talking about gyms.py - yes it is intended to not autoupdate

vanwinkelseppe commented 8 years ago

@Aiyubi I think he means that after X amount of time the Gyms change from team to team on the map. Or in the report using more recent data but my map has been running 10 hours and the gym's are added to the db, one sighting is added after that Gym's are not touched (No other sightings are added). Which means the data is outdated. Generated 0 minutes ago using data from 1054 minutes ago gathered by pokeminer

dhpancor commented 8 years ago

Same here. Gyms don't update.

andrewbroberg commented 8 years ago

Mine seem to be updating fine, using MySQL for database.

batttie commented 8 years ago

Reporting the same issues using sqllite

Aiyubi commented 8 years ago

I think I found several logical issues with the sorting and caching. Im on it right now.

modrzew commented 8 years ago

Is this related to the live map, or to the entries in database? Entries in database are updating fine (at least for me), and gyms.py also uses new results. I'm not sure about the live map.

Aiyubi commented 8 years ago

@modrzew since I am bad with sql and stuck I will tell you my first finding:

        existing = session.query(FortSighting) \
            .filter(FortSighting.fort_id == fort.id) \
            .filter(FortSighting.team == raw_fort['team']) \
            .filter(FortSighting.prestige == raw_fort['prestige']) \
            .filter(FortSighting.guard_pokemon_id ==
                    raw_fort['guard_pokemon_id']) \
            .first()
        if existing:
            # Why it's not in cache? It should be there!
            FORT_CACHE.add(raw_fort)
            return

So what if:

Aiyubi commented 8 years ago

told you earlier I'm bad with sql? turns out I am not as bad as I thought

running the query in get_forts results in always the oldest data query the sql from get_forts through mysql interface: works perfectly fine and results in newest data

edit: I'm going crazy. Now it is not working in mysql anymore

vanwinkelseppe commented 8 years ago

@modrzew The problem is in both. (In python 2.7) Gyms are not updated on live map or neither in the gym report. This is my gym report footer: Generated 0 minutes ago using data from 2403 minutes ago gathered by pokeminer data is more then 40 hours out of date. From what I can see, the gym's are updating in the database.

schermafbeelding 2016-08-10 om 14 21 41
modrzew commented 8 years ago

Might this be the same issue as in #172? If so, you could try upgrading to v0.5.1 and see whether the issue goes away.

Aiyubi commented 8 years ago

@modrzew as I tried to comment on that issue: get_forts with that fix returns all entrys

>>> len(db.get_forts(session))
80219
Aiyubi commented 8 years ago

okay #198 is a fix that works for me