From 7608b9b29887f25db878c1ca59d6b972521ae212 Mon Sep 17 00:00:00 2001 From: Zachary Klosko Date: Thu, 31 Dec 2020 12:18:33 -0500 Subject: [PATCH] Removing bandwidth tracking --- .../application/common/TaskManager.php | 33 ---------- airtime_mvc/application/models/Preference.php | 62 ------------------- .../views/scripts/listenerstat/index.phtml | 13 ---- 3 files changed, 108 deletions(-) diff --git a/airtime_mvc/application/common/TaskManager.php b/airtime_mvc/application/common/TaskManager.php index 514d9f45c..e110b2fe4 100644 --- a/airtime_mvc/application/common/TaskManager.php +++ b/airtime_mvc/application/common/TaskManager.php @@ -331,39 +331,6 @@ class StationPodcastTask implements AirtimeTask { } -/** - * TODO: this and the above StationPodcastTask should probably be unified since the - * behaviour is essentially identical - * - * Class BandwidthLimitTask - * - * Checks the bandwidth limit rollover timer and resets the allotted - * limit if enough time has passed (default: 1 month) - */ -class BandwidthLimitTask implements AirtimeTask { - - const BANDWIDTH_LIMIT_RESET_TIMER_SECONDS = 2.628e+6; - - /** - * Check whether the task should be run - * - * @return bool true if the task needs to be run, otherwise false - */ - public function shouldBeRun() { - $lastReset = Application_Model_Preference::getBandwidthLimitResetTimer(); - return empty($lastReset) || (microtime(true) > ($lastReset + self::BANDWIDTH_LIMIT_RESET_TIMER_SECONDS)); - } - - /** - * Run the task - */ - public function run() { - Application_Model_Preference::resetStationPodcastDownloadCounter(); - Application_Model_Preference::setBandwidthLimitResetTimer(microtime(true)); - } - -} - /** * Class TaskFactory Factory class to abstract task instantiation */ diff --git a/airtime_mvc/application/models/Preference.php b/airtime_mvc/application/models/Preference.php index cbb256481..17448b7fb 100644 --- a/airtime_mvc/application/models/Preference.php +++ b/airtime_mvc/application/models/Preference.php @@ -1573,68 +1573,6 @@ class Application_Model_Preference self::setValue("station_podcast_privacy", $value); } - /** - * Accessors for station bandwidth limit. - */ - public static function getBandwidthLimit() { - return self::getValue("bandwidth_limit"); - } - - public static function setBandwidthLimit($value) { - self::setValue("bandwidth_limit", $value); - } - - /** - * Accessors for bandwidth limit counter. - * Tracks bandwidth usage. - * - * @see ApiController::bandwidthUsageAction() - * @see BandwidthLimitTask - */ - - public static function getBandwidthLimitCounter() { - return self::getValue("bandwidth_limit_counter"); - } - - public static function incrementBandwidthLimitCounter($value) { - $counter = intval(self::getValue("bandwidth_limit_counter")); - self::setValue("bandwidth_limit_counter", $counter + intval($value)); - } - - public static function resetBandwidthLimitCounter() { - self::setValue("bandwidth_limit_counter", 0); - } - - /** - * Accessors for bandwidth limit reset timer. - * Used to determine when to reset the bandwidth counter for the station. - * - * @see BandwidthLimitTask - */ - - public static function getBandwidthLimitResetTimer() { - return self::getValue("bandwidth_limit_reset_timer"); - } - - public static function setBandwidthLimitResetTimer($value) { - self::setValue("bandwidth_limit_reset_timer", $value); - } - - /** - * Accessors for bandwidth limit update timer. - * Used to determine when the bandwidth was last updated for this station. - * - * @see ApiController::bandwidthUsageAction() - */ - - public static function getBandwidthLimitUpdateTimer() { - return self::getValue("bandwidth_limit_update_timer"); - } - - public static function setBandwidthLimitUpdateTimer() { - self::setValue("bandwidth_limit_update_timer", microtime(true)); - } - /** * Getter for CORS URLs * diff --git a/airtime_mvc/application/views/scripts/listenerstat/index.phtml b/airtime_mvc/application/views/scripts/listenerstat/index.phtml index fe12ca5f4..ccbcc15f6 100644 --- a/airtime_mvc/application/views/scripts/listenerstat/index.phtml +++ b/airtime_mvc/application/views/scripts/listenerstat/index.phtml @@ -15,17 +15,4 @@
- - - - -
-
-
-
-
;">
- -
-
-