+
+ /**
+ * @param array|int $run_parameters Priority constant or array of options described in Worker::add
+ * @param string $serverUrl
+ * @param bool $onlyNodeInfo Only use NodeInfo for server detection
+ * @return int
+ * @throws InternalServerErrorException
+ */
+ public static function add($run_parameters, string $serverUrl, bool $onlyNodeInfo = false): int
+ {
+ // Dropping the worker task if the server domain is blocked
+ if (Network::isUrlBlocked($serverUrl)) {
+ GServer::setBlockedByUrl($serverUrl);
+ return 0;
+ }
+
+ // We have to convert the Uri back to string because worker parameters are saved in JSON format which
+ // doesn't allow for structured objects.
+ return Worker::add($run_parameters, 'UpdateGServer', $serverUrl, $onlyNodeInfo);
+ }