oTree Forum >

Timing out with upcoming_apps[-1]

#1 by ZB08

I am running a study in which subjects participate until they hit a time limit (e.g. 1 hour). 

For reasons I will not get into, the study consists of a sequence of apps - call it 20. On a wait page at the beginning of each app, the code checks whether an hour has passed. If not, the subject continues. If yes, then then I use the code

    @staticmethod
    def app_after_this_page(player, upcoming_apps):
        if player.session.vars['alive'] is False:
            return upcoming_apps[-1]
            
which takes the subject to the app that deals with payments.

The problem is that this code takes a very long time to run. With 8 subjects in a session, it can take around 2 minutes to get them to the payment page. This makes it so that I cannot even run the experiment on Heroku because everything times out when going to the payment page.

Does anyone have an idea about what I am doing wrong?

Write a reply

Set forum username