Deadline doif condition is not working to refresh the token

I am checking to see if deadline is overdue then invoke access token method to add the new token to the session, but this method never gets executed. Can you please advise to refresh the token before it expires? or any other solutions? I cant find a solution that works

val deadline = 180.seconds.fromNow
private val submitOrders: ScenarioBuilder =
scenario(“Orders Submission for Round 1”)
.doIf(deadline.isOverdue()) {
exec(AuthRequest.auth_token) }. → this method sets the token in the session
.exec(bidOrder())

You have to pass a function, see Gatling - Functions

Here, you’re just passing a static value. It doesn’t matter that it’s computed by a method.