Timestamp only based prioritization of repoman pending accounts is probably not best approach here.

I may be wrong, but I think it should have a count of demands and probably a timestamp as a part for implementing a time-decaying counter, something like demand_count*Math.exp(demand_time - Time.now). Or, I think without a timestamp, the counter should be zeroed always after the repoman is completed. Time factor will be self-contained in the counter value in this case.

Please review the change: as the demand counter is incremented on each poll in the loop, sessions waiting the longest will be mainly ordered top to bottom due to the counter value.

Does it make sense for you?