From 8cac8fd3ce38ecd2f7c9cfc8898eb0b6fb61c920 Mon Sep 17 00:00:00 2001 From: Rhilip Date: Fri, 28 Jun 2019 19:24:48 +0800 Subject: [PATCH] perf(Tracker): Use brpoplpush to get announce data from redis --- CHANGELOG.md | 9 ++++---- apps/timer/TrackerAnnounceTimer.php | 2 +- apps/views/admin/redis_keys.php | 34 +++++++++++++++-------------- 3 files changed, 24 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9db7893..68baf22 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,8 @@ ## [Unreleased] - -## [v0.1.4-alpha] - 2019-06-28 + +## [0.1.4-alpha] - 2019-06-28 ### Chore - **User:** Make User component as Part of App but not framework @@ -11,6 +11,7 @@ - **Licence:** Add Licence Checker By FOSSA - **Migration:** Update Nginx config - **README:** Fix Mailer Env typo +- **release:** v0.1.4-alpha ### Feat - **Auth:** Add UserRecover Form @@ -236,8 +237,8 @@ Structure of Table `users_session_log` Change ## v0.1.0-alpha - 2019-01-30 -[Unreleased]: https://github.com/Rhilip/ridpt/compare/v0.1.4-alpha...HEAD -[v0.1.4-alpha]: https://github.com/Rhilip/ridpt/compare/v0.1.3-alpha...v0.1.4-alpha +[Unreleased]: https://github.com/Rhilip/ridpt/compare/0.1.4-alpha...HEAD +[0.1.4-alpha]: https://github.com/Rhilip/ridpt/compare/v0.1.3-alpha...0.1.4-alpha [v0.1.3-alpha]: https://github.com/Rhilip/ridpt/compare/v0.1.2-alpha...v0.1.3-alpha [v0.1.2-alpha]: https://github.com/Rhilip/ridpt/compare/v0.1.1-alpha...v0.1.2-alpha [v0.1.1-alpha]: https://github.com/Rhilip/ridpt/compare/v0.1.0-alpha...v0.1.1-alpha diff --git a/apps/timer/TrackerAnnounceTimer.php b/apps/timer/TrackerAnnounceTimer.php index bd81b16..52277b6 100644 --- a/apps/timer/TrackerAnnounceTimer.php +++ b/apps/timer/TrackerAnnounceTimer.php @@ -15,7 +15,7 @@ class TrackerAnnounceTimer extends Timer public function init() { while (true) { - $data_raw = app()->redis->rpoplpush('Tracker:to_deal_queue', 'Tracker:backup_queue'); + $data_raw = app()->redis->brpoplpush('Tracker:to_deal_queue', 'Tracker:backup_queue', 5); if ($data_raw !== false) { $data = unserialize($data_raw); app()->pdo->beginTransaction(); diff --git a/apps/views/admin/redis_keys.php b/apps/views/admin/redis_keys.php index 55e8644..2f7e1f1 100644 --- a/apps/views/admin/redis_keys.php +++ b/apps/views/admin/redis_keys.php @@ -19,6 +19,7 @@ \Redis::REDIS_SET => 'Set', \Redis::REDIS_ZSET => 'Zset' ]; +$suggent_pattern = ['*', 'SESSION:*', 'TORRENT:*', 'TRACKER:*', 'USER:*']; // FIXME fix this pattern group ?> layout('admin/layout') ?> @@ -29,25 +30,26 @@

Redis Keys Status

Please input the search pattern of keys, or your can use the search suggest

-
- - - -
- Search Keys - - > - +
+ + + + +
+ Search Keys + + > + -
- - -
Suggest Pattern : - -    - +
+
Suggest Pattern : + +    + +
+