1. Brent Tubbs
  2. trollop
  3. Issues
Issue #5 new

Results are cached between calls to the API

Anonymous created an issue


I've been doing some simple tests of integrating Jira and Trello using trollop an it's going really well so far.

I ran into a problem though. I'm using the Tornado web server, and I noticed that if I created a card, when I next queried the board to get its cards, the new card wasn't there.

I had a look at the source and I can see that the AJAX requests are cached in the objects' _data variable, but this doesn't explain why I would be getting the same (incorrect) results between two independent invocations of the API.

I read that the requests library does automatic connection pooling, and I wondered if that could be the problem.

I created a small example that shows the same behavior here: https://gist.github.com/anonymous/e099c732c7312623b45d



Comments (5)

  1. Brent Tubbs repo owner

    That's surprising. Can you try reproducing with plain old Curl on the command line? I'd like to rule out the possibility that Trello has a cache on their end that takes a minute to get updated.

  2. funkyoldwitch

    I'll try that. On subsequent runs of the example above though, the card created on the previous run is listed in the second run. And I can run them right after each other and see that behavior.

  3. Dan Ford

    I'm also getting this issue. Trying to create something that updates the cards every x minutes... (using Celery periodic task). Updates are only reflected if I manually stop, then restart the Celery periodic task.

    Is there a way to kill off the connection and any associated cache?

  4. Brent Tubbs repo owner

    The trollop connection object is just a wrapper over the Requests library. It should be fine to create a fresh one inside your task and let it get garbage collected after the task is done, rather than keeping one around a long time.

  5. Jean Jordaan

    As far as I can see, the lazy call is made only once, to populate the local structure. E.g. somelist.cards fetches the cards the first time. If I then add a card (somelist.add_card('some', 'card'), it is absent from the cards attribute of the list. If I fetch all the cards for the board (board.cards) the new card is present in the cards attribute of the board object.

    How should refresh work? Would it be possible to get a feed of changes since last fetch from Trello and update touched local objects?

  6. Log in to comment