summaryrefslogtreecommitdiff
path: root/lib/GitHub/Collector/Role/Pause.pm
diff options
context:
space:
mode:
authorfranck cuny <franck@lumberjaph.net>2011-06-13 16:33:23 +0200
committerfranck cuny <franck@lumberjaph.net>2011-06-13 16:33:23 +0200
commit871336c030209b46ae6b124a702677363487f9a8 (patch)
tree86f234d42c68b26a7aeb9cc373667127ad661e19 /lib/GitHub/Collector/Role/Pause.pm
parentuse template_toolkit and add infos about colors (diff)
downloadstargit-871336c030209b46ae6b124a702677363487f9a8.tar.gz
import github::collector
Signed-off-by: franck cuny <franck@lumberjaph.net>
Diffstat (limited to '')
-rw-r--r--lib/GitHub/Collector/Role/Pause.pm18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/GitHub/Collector/Role/Pause.pm b/lib/GitHub/Collector/Role/Pause.pm
new file mode 100644
index 0000000..ba7a779
--- /dev/null
+++ b/lib/GitHub/Collector/Role/Pause.pm
@@ -0,0 +1,18 @@
+package GitHub::Collector::Role::Pause;
+
+use Moose::Role;
+
+has pause_on_error => (
+ is => 'ro',
+ isa => 'Int',
+ default => 10,
+);
+
+sub pause {
+ my $self = shift;
+ my $rand = int(rand(10));
+ my $pause = $rand == 1 ? $rand : 0;
+ sleep($pause);
+}
+
+1;