Currently we have a process where any query running over 2 mins (only select) in primary database participating in db mirroring is killed, running every 5 mins.
As we have moved to Availability groups now secondary has become readable replica so users can run queries there coming with application_intent ='read only'
However we still need the job to kill long running query over 2 mins on primary replica as new users onboard there are always chances of them hitting primary database. How can i change my current job on both primary and secondary replica so that it only kills long running query on P replica and not readable without me changing job configuration every-time.
Thanks,