File tree Expand file tree Collapse file tree 3 files changed +34
-8
lines changed Expand file tree Collapse file tree 3 files changed +34
-8
lines changed Original file line number Diff line number Diff line change @@ -47,8 +47,11 @@ sub _queue_latest {
47
47
my $dist = shift || $self -> distribution;
48
48
49
49
log_info { " queueing " . $dist };
50
- $self -> _add_to_queue( index_latest =>
51
- [ ( $self -> force ? ' --force' : () ), ' --distribution' , $dist ] );
50
+ $self -> _add_to_queue(
51
+ index_latest =>
52
+ [ ( $self -> force ? ' --force' : () ), ' --distribution' , $dist ],
53
+ { attempts => 3 }
54
+ );
52
55
}
53
56
54
57
sub run {
Original file line number Diff line number Diff line change @@ -32,12 +32,18 @@ sub run {
32
32
33
33
my $next = $rule -> iter( $self -> dir );
34
34
while ( defined ( my $file = $next -> () ) ) {
35
- $self -> _add_to_queue( index_release => [$file ] );
35
+ $self -> _add_to_queue(
36
+ index_release => [$file ],
37
+ { attempts => 3 }
38
+ );
36
39
}
37
40
}
38
41
39
42
if ( $self -> _has_file ) {
40
- $self -> _add_to_queue( index_release => [ $self -> file-> stringify ] );
43
+ $self -> _add_to_queue(
44
+ index_release => [ $self -> file-> stringify ],
45
+ { attempts => 3 }
46
+ );
41
47
}
42
48
}
43
49
Original file line number Diff line number Diff line change @@ -177,13 +177,30 @@ sub run {
177
177
178
178
if ( $self -> queue ) {
179
179
my $job_id = $self -> _add_to_queue(
180
- index_release => [$file ] => { priority => 3 } );
180
+ index_release => [$file ],
181
+ { attempts => 3, priority => 3 }
182
+ );
183
+
184
+ # This is a hack to deal with the fact that we don't know exactly
185
+ # when 02packages gets updated. It should be about every 5
186
+ # minutes. We could stop trying once something is already
187
+ # "latest", but some uploads will never be "latest". Trying this X
188
+ # times should be fairly cheap. If this doesn't work, there is a
189
+ # cleanup cron which can set the "latest" flag, if necessary.
181
190
182
191
if ( $self -> latest ) {
183
- $self -> _add_to_queue(
184
- index_latest => [ ' --distribution' , $d -> dist ] =>
185
- { priority => 2, parents => [$job_id ] } );
192
+ for my $delay ( 150, 330, 600 ) {
193
+ $self -> _add_to_queue(
194
+ index_latest => [ ' --distribution' , $d -> dist ] => {
195
+ attempts => 3,
196
+ delay => $delay ,
197
+ parents => [$job_id ],
198
+ priority => 2,
199
+ }
200
+ );
201
+ }
186
202
}
203
+
187
204
}
188
205
else {
189
206
try { $self -> import_archive($file ) }
You can’t perform that action at this time.
0 commit comments