Load timeout

If timeout is defined in JobAnnotation, this one is used.
Otherwise is used set in Class

@param WorkAnnotation $workAnnotation
@param array $defaultSettings

@return int
353987
private function loadTimeout(WorkAnnotation $workAnnotation, array $defaultSettings)
    {
        return is_null($workAnnotation->timeout)
            ? (int) $defaultSettings['timeout']
            : (int) $workAnnotation->timeout;
    }
156250
public static function getSetting( string $name, $defaultValue = null )
	{
		return self::isSettingSet($name)
			? self::$settings[$name]
			: $defaultValue;
	}
994411
public void setDefaults(Annotation[] defaultAnnotations) {
        if (defaultAnnotations == null) {
            return;
        }
        for (Annotation each : defaultAnnotations) {
            Class<? extends Annotation> key = each.annotationType();
            if (Title.class.equals(key) || Description.class.equals(key)) {
                continue;
            }
            if (!annotations.containsKey(key)) {
                annotations.put(key, each);
            }
        }
    }
205914
public function getSetting( string $name, $defaultValue = null )
	{
		return $this->isSettingSet($name)
			? $this->settings[$name]
			: $defaultValue;
	}
670773
public FormInputHandler timeout(final long theTimeoutSeconds) {
		checkArgument(theTimeoutSeconds > 0, "'theTimeoutSeconds' must be greater than zero");
		Fields fields = new Fields(this);
		fields.finder = fields.finder.timeout(theTimeoutSeconds);
		return new FormInputHandler(fields);
	}
698644
public function getJsonArray($annotation, $default = []) {
        $str = $this->getString($annotation);
        if (is_array($str)) {
            $rst = [];
            foreach ($str as $s) {
                $ss = preg_split('/\s+/', $s, 2);
                if (count($ss) == 2) {
                    list($k, $v) = $ss;
                } else {
                    $k = $ss[0];
                    $v = 1;
                }
                $rst[ $k ] = $v;
            }

            return $rst;
        }
        if ($str) {
            $str = trim($str);
            if (preg_match('#^[\[\{](.*)[\}\]]$#', $str)) {
                $rst = json_decode($str, true);
                if ($rst) {
                    return $rst;
                } else {
                    trigger_error($str . ' ' . json_last_error_msg(), E_USER_WARNING);
                }
            } else {
                @parse_str($str, $rst);
                if ($rst) {
                    return $rst;
                }
                trigger_error($str . ' Syntax error', E_USER_WARNING);
            }
        }

        return $default;
    }
519656
protected function determineDelayTimeout(array $options, ResponseInterface $response = null)
    {
        if (\is_callable($options['default_retry_multiplier'])) {
            $defaultDelayTimeout = (float) \call_user_func(
                $options['default_retry_multiplier'],
                $options['retry_count'],
                $response
            );
        } else {
            $defaultDelayTimeout = (float) $options['default_retry_multiplier'] * $options['retry_count'];
        }

        // Retry-After can be a delay in seconds or a date
        // (see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After)
        if ($response && $response->hasHeader('Retry-After')) {
            return
                $this->deriveTimeoutFromHeader($response->getHeader('Retry-After')[0])
                ?: $defaultDelayTimeout;
        }

        return $defaultDelayTimeout;
    }
482845
protected function getStatusCode(Rest\Action $annotation, GetResponseForControllerResultEvent $event): int
    {
        if ($annotation->isAutoStatusCode()) {
            if (null === $event->getControllerResult()) {
                return Response::HTTP_NO_CONTENT;
            }

            if (in_array($event->getRequest()->getMethod(), [Request::METHOD_POST, Request::METHOD_PUT])) {
                return Response::HTTP_CREATED;
            }
        }

        return $annotation->getStatusCode();
    }
818099
public void loadWithTimeout(int timeout) {

        for (String stylesheet : m_stylesheets) {
            boolean alreadyLoaded = checkStylesheet(stylesheet);
            if (alreadyLoaded) {
                m_loadCounter += 1;
            } else {
                appendStylesheet(stylesheet, m_jsCallback);
            }
        }
        checkAllLoaded();
        if (timeout > 0) {
            Timer timer = new Timer() {

                @SuppressWarnings("synthetic-access")
                @Override
                public void run() {

                    callCallback();
                }
            };

            timer.schedule(timeout);
        }
    }
626455
protected function _timedOut()
    {
        $time = $this->read('Config.time');
        $result = false;

        $checkTime = $time !== null && $this->_lifetime > 0;
        if ($checkTime && (time() - (int)$time > $this->_lifetime)) {
            $result = true;
        }

        $this->write('Config.time', time());

        return $result;
    }
294467
public function setTimeout($timeout = 60)
    {
        $this->timeout = $timeout;
        $this->debug->info(__FUNCTION__, 'setTimeout: ', $this->timeout);

        return $this;
    }
1203691
private function checkDifferentAnnotations(Annotation $annotation, $linesCount)
    {
        if ($linesCount === 1) {
            return;
        }

        $this->phpcsFile->addError(
            \sprintf('Expected 1 lines between different annotations types, found %d.', $linesCount),
            $annotation->getStartPointer(),
            'LineBetweenDifferentTags'
        );
    }
12310
public static function createAnnotationMetadataConfiguration(array $paths, $isDevMode = false, $proxyDir = null, Cache $cache = null, $useSimpleAnnotationReader = true)
    {
        $config = self::createConfiguration($isDevMode, $proxyDir, $cache);
        $config->setMetadataDriverImpl($config->newDefaultAnnotationDriver($paths, $useSimpleAnnotationReader));

        return $config;
    }
551295
public function validateFieldSettings($fieldSettings)
    {
        $validationErrors = array();

        foreach ($fieldSettings as $name => $value) {
            if (!isset($this->settingsSchema[$name])) {
                $validationErrors[] = new ValidationError(
                    "Setting '%setting%' is unknown",
                    null,
                    array(
                        '%setting%' => $name,
                    ),
                    "[$name]"
                );
                continue;
            }

            switch ($name) {
                case 'defaultType':
                    $definedTypes = array(
                        self::DEFAULT_EMPTY,
                        self::DEFAULT_CURRENT_DATE,
                    );
                    if (!in_array($value, $definedTypes, true)) {
                        $validationErrors[] = new ValidationError(
                            "Setting '%setting%' is of unknown type",
                            null,
                            array(
                                '%setting%' => $name,
                            ),
                            "[$name]"
                        );
                    }
                    break;
            }
        }

        return $validationErrors;
    }
850439
public function autoloadWorkerAnnotation()
    {
        $beanScan = $this->getBeanScanNamespace();
        $resource = new WorkerAnnotationResource($this->properties);
        $resource->addScanNamespace($beanScan);
        $definitions = $resource->getDefinitions();

        $this->definitions = \array_merge($definitions, $this->definitions);
    }
890778
private function handleDefaultSettingsLoading(ContainerBuilder $container, FileLoader $loader)
    {
        $loader->load('default_settings.yml');

        if (!$this->isRichTextBundleEnabled($container)) {
            $loader->load('ezrichtext_default_settings.yml');
        }

        foreach ($this->defaultSettingsCollection as $fileLocation => $files) {
            $externalLoader = new Loader\YamlFileLoader($container, new FileLocator($fileLocation));
            foreach ($files as $file) {
                $externalLoader->load($file);
            }
        }
    }
820295
public void annotateDefaultValueLater(JCExpression defaultValue, Env<AttrContext> localEnv,
            MethodSymbol m, DiagnosticPosition deferPos)
    {
        normal(() -> {
            JavaFileObject prev = log.useSource(localEnv.toplevel.sourcefile);
            DiagnosticPosition prevLintPos = deferredLintHandler.setPos(deferPos);
            try {
                enterDefaultValue(defaultValue, localEnv, m);
            } finally {
                deferredLintHandler.setPos(prevLintPos);
                log.useSource(prev);
            }
        });

        validate(() -> { //validate annotations
            JavaFileObject prev = log.useSource(localEnv.toplevel.sourcefile);
            try {
                // if default value is an annotation, check it is a well-formed
                // annotation value (e.g. no duplicate values, no missing values, etc.)
                chk.validateAnnotationTree(defaultValue);
            } finally {
                log.useSource(prev);
            }
        });
    }