How can I refresh the sitetree

Silverstripe Version:
4.1.1

I have added a button to the CMS to archive expired event pages. The action in the LeftAndMainExtension is below.

/**
 * Action to remove expired events
 * 
 * @return SS_HTTPResponse
 */
public function removeOldEvents($data, $form) {
     // get old events
    $datalist = EventPage::get()->where("\"EventPage\".\"ClosingDate\" < Now() AND \"EventPage\".\"ClosingDate\" <> '0000-00-00'");
    foreach($datalist as $record) {
        $record->doArchive();
    }
    // we need a way to refresh the sitetree to remove archived items
		
    // this generates a message that will show up in the CMS
    $this->owner->response->addHeader('X-Status', rawurlencode('Removed old events!'));
    return $this->owner->getResponseNegotiator()->respond($this->owner->request);		
    }

Is there any way to refresh the sitetree to remove the archived pages before I return the message ‘Removed old events’ to the user?

Looks like you can trigger a reload of the site tree with:

Seems like the CMS currently fetches a site tree update immediately after you submit the edit form, rather than waiting for a response from the server:

Maybe that’s why it can be so unreliable? ¯\_(ツ)_/¯