當前位置: 首頁>>代碼示例>>PHP>>正文


PHP backupbuddy_core::detectLikelyHighestExecutionTime方法代碼示例

本文整理匯總了PHP中backupbuddy_core::detectLikelyHighestExecutionTime方法的典型用法代碼示例。如果您正苦於以下問題:PHP backupbuddy_core::detectLikelyHighestExecutionTime方法的具體用法?PHP backupbuddy_core::detectLikelyHighestExecutionTime怎麽用?PHP backupbuddy_core::detectLikelyHighestExecutionTime使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在backupbuddy_core的用法示例。


在下文中一共展示了backupbuddy_core::detectLikelyHighestExecutionTime方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: _fileoptions_lock_ignore_timeout_value

 private static function _fileoptions_lock_ignore_timeout_value()
 {
     return backupbuddy_core::detectLikelyHighestExecutionTime() + backupbuddy_constants::TIMED_OUT_PROCESS_RESUME_WIGGLE_ROOM;
 }
開發者ID:arobbins,項目名稱:spellestate,代碼行數:4,代碼來源:live_periodic.php

示例2: die

if (false === ($stats = backupbuddy_api::getLiveStats())) {
    // Live is disconnected.
    die('-1');
}
echo json_encode($stats);
// If there is more to do and too long of time has passed since activity then try to jumpstart the process at the beginning.
if ((0 == $stats['files_total'] || $stats['files_sent'] < $stats['files_total']) && 'wait_on_transfers' != $stats['current_function']) {
    // ( Files to send not yet calculated OR more remain to send ) AND not on the wait_on_transfers step.
    $time_since_last_activity = microtime(true) - $stats['last_periodic_activity'];
    if ($time_since_last_activity < 30) {
        // Don't even bother getting max execution time if it's been less than 30 seconds since run.
        // do nothing
    } else {
        // More than 30 seconds since last activity.
        // Detect max PHP execution time. If TESTED value is higher than PHP value then go with that since we want to err on not overlapping processes here.
        $detected_execution = backupbuddy_core::detectLikelyHighestExecutionTime();
        if ($time_since_last_activity > $detected_execution + backupbuddy_constants::TIMED_OUT_PROCESS_RESUME_WIGGLE_ROOM) {
            // Enough time has passed to assume timed out.
            require_once pb_backupbuddy::plugin_path() . '/destinations/live/live.php';
            if (false === ($liveID = backupbuddy_live::getLiveID())) {
                die('-1');
            }
            if ('1' != pb_backupbuddy::$options['remote_destinations'][$liveID]['pause_periodic']) {
                // Only proceed if NOT paused.
                pb_backupbuddy::status('warning', 'BackupBuddy Stash Live process appears timed out while user it viewing Live page. Forcing run now.');
                $cronArgs = array();
                $schedule_result = backupbuddy_core::schedule_single_event(time(), 'live_periodic', $cronArgs);
                if (true === $schedule_result) {
                    pb_backupbuddy::status('details', 'Next Live Periodic chunk step cron event scheduled.');
                } else {
                    pb_backupbuddy::status('error', 'Next Live Periodic chunk step cron event FAILED to be scheduled.');
開發者ID:arobbins,項目名稱:spellestate,代碼行數:31,代碼來源:live_stats.php


注:本文中的backupbuddy_core::detectLikelyHighestExecutionTime方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。