Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

executable file 41 lines (35 sloc) 1.223 kB
# bin/schedule-copier-jobs
# A simple job that schedules copier tasks for the sphinx copier. This should
# be run whenever you want to clean up the database of new/old data. Probably
# no more often than once every few weeks.
# Authors:
# Mark Smith <>
# Copyright (c) 2009 by Dreamwidth Studios, LLC.
# This program is free software; you may redistribute it and/or modify it under
# the same terms as Perl itself. For a copy of the license, please reference
# 'perldoc perlartistic' or 'perldoc perlgpl'.
use strict;
use lib "$ENV{LJHOME}/extlib/lib/perl5";
use lib "$ENV{LJHOME}/cgi-bin";
require '';
die "Need to have Sphinx search enabled.\n"
my $dbr = LJ::get_db_reader() or die;
my $sth = $dbr->prepare( q{SELECT userid FROM user WHERE journaltype IN ('P','C')} );
my $sclient = LJ::theschwartz() or die;
while ( my ( $userid ) = $sth->fetchrow_array ) {
warn "Scheduling $userid ...\n";
$sclient->insert_jobs( TheSchwartz::Job->new_from_array( 'DW::Worker::Sphinx::Copier',
{ userid => $userid, source => "schedule" } ) );
select undef, undef, undef, 0.02;
Jump to Line
Something went wrong with that request. Please try again.