private function reindexResources() {
        if (count($this->resToReindex) == 0) {
            return;
        }

        $this->begin();
        foreach (array_unique($this->resToReindex) as $i) {
            try {
                $res = $this->getResourceByUri($i);
                $res->setMetadata($res->getMetadata());
                $res->updateMetadata();
            } catch (Deleted $e) {
                
            } catch (NotFound $e) {
                
            }
        }
        $this->resToReindex = [];
        $this->commit();
    }