Skip to content

Commit

Permalink
added PostgreSQL support with Mojo::Pg
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Nov 11, 2014
1 parent b2b18b7 commit a6a322f
Show file tree
Hide file tree
Showing 7 changed files with 807 additions and 22 deletions.
8 changes: 6 additions & 2 deletions .travis.yml
Expand Up @@ -6,10 +6,14 @@ perl:
- "5.14"
- "5.12"
- "5.10"
addons:
postgresql: "9.3"
env:
- "HARNESS_OPTIONS=j9 TEST_POD=1"
- "HARNESS_OPTIONS=j9 TEST_POD=1 TEST_ONLINE=postgresql://postgres@/minion_test"
install:
- "cpanm -n Test::Pod Test::Pod::Coverage"
- "cpanm -n Mojo::Pg Test::Pod Test::Pod::Coverage"
- "cpanm -n --installdeps ."
before_script:
- psql -c 'create database minion_test;' -U postgres
notifications:
email: false
4 changes: 3 additions & 1 deletion Changes
@@ -1,6 +1,8 @@

0.40 2014-10-10
0.40 2014-10-11
- Added PostgreSQL support with Mojo::Pg. (bpmedley, sri)
- Added support for job results.
- Added Minion::Backend::Pg. (bpmedley, sri)

0.39 2014-10-05
- Added DBM::Deep support to Minion::Backend::File.
Expand Down
15 changes: 13 additions & 2 deletions lib/Minion.pm
Expand Up @@ -87,7 +87,8 @@ Minion - Job queue
use Minion;
# Connect to backend
my $minion = Minion->new(File => '/Users/sri/minion.db');
my $minion = Minion->new(File => '/Users/sri/minion.db');
my $minion = Minion->new(Pg => 'postgresql://postgres@/test');
# Add tasks
$minion->add_task(something_slow => sub {
Expand Down Expand Up @@ -164,7 +165,7 @@ Application for job queue, defaults to a L<Mojo::HelloWorld> object.
my $backend = $minion->backend;
$minion = $minion->backend(Minion::Backend::File->new);
Backend, usually a L<Minion::Backend::File> object.
Backend, usually a L<Minion::Backend::File> or L<Minion::Backend::Pg> object.
=head2 remove_after
Expand Down Expand Up @@ -269,6 +270,16 @@ Build L<Minion::Worker> object.
Sebastian Riedel, C<sri@cpan.org>.
=head1 CREDITS
In alphabetical order:
=over 2
Brian Medley
=back
=head1 COPYRIGHT AND LICENSE
Copyright (C) 2014, Sebastian Riedel.
Expand Down
3 changes: 1 addition & 2 deletions lib/Minion/Backend/File.pm
Expand Up @@ -38,8 +38,7 @@ sub enqueue {
return $job->{id};
}

sub fail_job { shift->_update(1, @_) }

sub fail_job { shift->_update(1, @_) }
sub finish_job { shift->_update(0, @_) }

sub job_info {
Expand Down

0 comments on commit a6a322f

Please sign in to comment.