Changeset 950493
- Timestamp:
- 07/17/2014 05:05:15 PM (12 years ago)
- Location:
- busy-server/trunk
- Files:
-
- 2 edited
-
busy-server-admin.php (modified) (1 diff)
-
busy-server.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
busy-server/trunk/busy-server-admin.php
r950276 r950493 4 4 Plugin URI: https://github.com/gibboncz/busy-server 5 5 Description: When the server load is higher than specified, show an error message instead of loading the page. 6 Version: 0.2 6 Version: 0.2.1 7 7 Author: Lubos Svoboda 8 8 */ -
busy-server/trunk/busy-server.php
r950276 r950493 4 4 Plugin URI: http://wordpress.org/plugins/busy-server/ 5 5 Description: When the server load is higher than specified, show an error message instead of loading the page. 6 Version: 0.2 6 Version: 0.2.1 7 7 Author: Lubos Svoboda 8 8 */ … … 73 73 if (!function_exists('busy_server_show')) { 74 74 function busy_server_show() { 75 $busy_msg = 'Server is busy. Please try reloading this page after few minutes.';76 75 $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 77 78 echo $busy_msg; 78 79 exit; … … 95 96 function busy_server_start() { 96 97 97 //default maximum load values:98 $max_load_win = 98; // percentage99 $max_load_unix = 2; //load per core ( 1.0 = 100%)100 101 102 98 $load_arr = busy_server_load(); 103 99 if (!empty($load_arr)) { … … 112 108 $cur_load = intval($load_arr[1]); 113 109 $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 114 112 if ($cur_load > $max_load_win) 115 113 busy_server_show(); … … 119 117 $cur_load = busy_server_calculate_load($load_arr[0]); 120 118 $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%) 121 121 if ($cur_load > $max_load_unix) 122 122 busy_server_show();
Note: See TracChangeset
for help on using the changeset viewer.