HEX
Server: Apache
System: Linux webd006.cluster128.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64
User: zwafgyp (177615)
PHP: 7.4.33
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/zwafgyp/coolswim/wp-content/plugins/sitepress-multilingual-cms/classes/editor/ATERetry.php
<?php


namespace WPML\TM\Editor;


use WPML\LIB\WP\Option;

class ATERetry {

	/**
	 * @param int $jobId
	 *
	 * @return bool
	 */
	public static function hasFailed( $jobId ) {
		return self::getCount( $jobId ) >= 0;
	}

	/**
	 * @param int $jobId
	 *
	 * @return int
	 */
	public static function getCount( $jobId ) {
		return (int) Option::getOr( self::getOptionName( $jobId ), - 1 );
	}

	/**
	 * @param int $jobId
	 */
	public static function incrementCount( $jobId ) {
		Option::update( self::getOptionName( $jobId ), self::getCount( $jobId ) + 1 );
	}

	/**
	 * @param int $jobId
	 */
	public static function reset( $jobId ) {
		Option::delete( self::getOptionName( $jobId ) );
	}

	/**
	 * @param int $jobId
	 *
	 * @return string
	 */
	public static function getOptionName( $jobId ) {
		return sprintf( 'wpml-ate-job-retry-counter-%d', $jobId );
	}
}