<canbeedited>1</canbeedited>
<canbedisabled>1</canbedisabled>
</cronjob>
+
+ <cronjob name="com.woltlab.wcf.rebuildSitemap">
+ <classname>wcf\system\cronjob\RebuildSitemapCronjob</classname>
+ <description>Rebuilds the sitemap</description>
+ <description language="de">Aktualisiert die Sitemap</description>
+ <startminute>0</startminute>
+ <starthour>3</starthour>
+ <startdom>*</startdom>
+ <startmonth>*</startmonth>
+ <startdow>*</startdow>
+ <canbeedited>1</canbeedited>
+ <canbedisabled>1</canbedisabled>
+ </cronjob>
</import>
<delete>
--- /dev/null
+<?php
+namespace wcf\system\cronjob;
+use wcf\data\cronjob\Cronjob;
+use wcf\system\worker\SitemapRebuildWorker;
+
+/**
+ * Rebuild the sitemap.
+ *
+ * @author Joshua Ruesweg
+ * @copyright 2001-2017 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package WoltLabSuite\Core\System\Cronjob
+ * @since 3.1
+ */
+class RebuildSitemapCronjob extends AbstractCronjob {
+ /**
+ * @inheritDoc
+ */
+ public function execute(Cronjob $cronjob) {
+ parent::execute($cronjob);
+
+ $worker = new SitemapRebuildWorker([]);
+ $count = 0;
+
+ while($worker->getProgress() < 100) {
+ $worker->setLoopCount($count);
+ $worker->execute();
+ $count++;
+ }
+ }
+}