Last active
April 16, 2016 18:21
-
-
Save brianmed/a594ef61e7308955ca84bc422bf001bf to your computer and use it in GitHub Desktop.
First possibility for queue information in Minion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/Minion/Backend/Pg.pm b/lib/Minion/Backend/Pg.pm | |
index 63fd507..92e6d31 100644 | |
--- a/lib/Minion/Backend/Pg.pm | |
+++ b/lib/Minion/Backend/Pg.pm | |
@@ -164,6 +164,17 @@ sub stats { | |
return $stats; | |
} | |
+sub queue_info { | |
+ shift->pg->db->query( | |
+ 'select id, args, attempts, extract(epoch from created) as created, | |
+ extract(epoch from delayed) as delayed, | |
+ extract(epoch from finished) as finished, priority, queue, result, | |
+ extract(epoch from retried) as retried, retries, | |
+ extract(epoch from started) as started, state, task, worker | |
+ from minion_jobs where queue = ?', shift | |
+ )->expand->hash; | |
+} | |
+ | |
sub unregister_worker { | |
shift->pg->db->query('delete from minion_workers where id = ?', shift); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment