If pipeline is manually stopped then "after_script" should run

There is a new response to "If I manually terminate the pipeline then my after_script does not run but I need to clean up all docker containers which happens through after_script so how I can achieve that?