Skip to content

Commit 3592466

Browse files
committed
Reload data from rich embeds after 30 days
1 parent b71665f commit 3592466

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

wcfsetup/install/files/lib/data/unfurl/url/UnfurlUrlAction.class.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
*/
2020
class UnfurlUrlAction extends AbstractDatabaseObjectAction
2121
{
22+
public const REFETCH_UNFURL_URL = 30 * 86_400;
23+
2224
/**
2325
* @inheritDoc
2426
*/
@@ -98,6 +100,14 @@ public function findOrCreate(): UnfurlUrl
98100
return $returnValues['returnValues'];
99101
}
100102

103+
if ($object->status !== UnfurlUrl::STATUS_PENDING && $object->lastFetch < \TIME_NOW - self::REFETCH_UNFURL_URL) {
104+
BackgroundQueueHandler::getInstance()->enqueueIn([
105+
new UnfurlUrlBackgroundJob($object),
106+
]);
107+
108+
BackgroundQueueHandler::getInstance()->forceCheck();
109+
}
110+
101111
return $object;
102112
}
103113
}

0 commit comments

Comments
 (0)