Plugin Directory

Changeset 950493


Ignore:
Timestamp:
07/17/2014 05:05:15 PM (12 years ago)
Author:
gibbon.cz
Message:

fixed defaults

Location:
busy-server/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • busy-server/trunk/busy-server-admin.php

    r950276 r950493  
    44Plugin URI: https://github.com/gibboncz/busy-server
    55Description: When the server load is higher than specified, show an error message instead of loading the page.
    6 Version: 0.2
     6Version: 0.2.1
    77Author: Lubos Svoboda
    88*/
  • busy-server/trunk/busy-server.php

    r950276 r950493  
    44Plugin URI: http://wordpress.org/plugins/busy-server/
    55Description: When the server load is higher than specified, show an error message instead of loading the page.
    6 Version: 0.2
     6Version: 0.2.1
    77Author: Lubos Svoboda
    88*/
     
    7373if (!function_exists('busy_server_show')) {
    7474    function busy_server_show() {
    75         $busy_msg = 'Server is busy. Please try reloading this page after few minutes.';
    7675        $busy_msg = get_option('busy_server_busy_message');
     76        if (empty($busy_msg))
     77            $busy_msg = 'Server is busy. Please try reloading this page after few minutes.'; // default message
    7778        echo $busy_msg;
    7879        exit;
     
    9596    function busy_server_start() {
    9697
    97         //default maximum load values:
    98         $max_load_win = 98; // percentage
    99         $max_load_unix = 2; //load per core ( 1.0 = 100%)
    100    
    101 
    10298        $load_arr = busy_server_load();
    10399        if (!empty($load_arr)) {
     
    112108                $cur_load = intval($load_arr[1]);
    113109                $max_load_win = floatval(get_option('busy_server_max_load'));
     110                if (empty($max_load_win))
     111                    $max_load_win = 98; // default max load percentage
    114112                if ($cur_load > $max_load_win)
    115113                    busy_server_show();
     
    119117                $cur_load = busy_server_calculate_load($load_arr[0]);
    120118                $max_load_unix = floatval(get_option('busy_server_max_load'));
     119                if (empty($max_load_unix))
     120                    $max_load_unix = 2; // default load per core ( 1.0 = 100%)
    121121                if ($cur_load > $max_load_unix)
    122122                    busy_server_show();
Note: See TracChangeset for help on using the changeset viewer.