@@ -46,7 +46,7 @@ pub fn start_daemon() {
46
46
}
47
47
48
48
// check new crates every minute
49
- thread:: spawn ( move || {
49
+ thread:: Builder :: new ( ) . name ( "crates.io reader" . to_string ( ) ) . spawn ( move || {
50
50
// space this out to prevent it from clashing against the queue-builder thread on launch
51
51
thread:: sleep ( Duration :: from_secs ( 30 ) ) ;
52
52
loop {
@@ -61,10 +61,10 @@ pub fn start_daemon() {
61
61
62
62
thread:: sleep ( Duration :: from_secs ( 60 ) ) ;
63
63
}
64
- } ) ;
64
+ } ) . unwrap ( ) ;
65
65
66
66
// build new crates every minute
67
- thread:: spawn ( move || {
67
+ thread:: Builder :: new ( ) . name ( "build queue reader" . to_string ( ) ) . spawn ( move || {
68
68
let opts = opts ( ) ;
69
69
let mut doc_builder = DocBuilder :: new ( opts) ;
70
70
@@ -198,11 +198,11 @@ pub fn start_daemon() {
198
198
* self = BuilderState :: QueueInProgress ( self . count ( ) + 1 ) ;
199
199
}
200
200
}
201
- } ) ;
201
+ } ) . unwrap ( ) ;
202
202
203
203
204
204
// update release activity everyday at 23:55
205
- thread:: spawn ( move || {
205
+ thread:: Builder :: new ( ) . name ( "release activity updater" . to_string ( ) ) . spawn ( move || {
206
206
loop {
207
207
thread:: sleep ( Duration :: from_secs ( 60 ) ) ;
208
208
let now = time:: now ( ) ;
@@ -213,30 +213,30 @@ pub fn start_daemon() {
213
213
}
214
214
}
215
215
}
216
- } ) ;
216
+ } ) . unwrap ( ) ;
217
217
218
218
219
219
// update search index every 3 hours
220
- thread:: spawn ( move || {
220
+ thread:: Builder :: new ( ) . name ( "search index updater" . to_string ( ) ) . spawn ( move || {
221
221
loop {
222
222
thread:: sleep ( Duration :: from_secs ( 60 * 60 * 3 ) ) ;
223
223
let conn = connect_db ( ) . expect ( "Failed to connect database" ) ;
224
224
if let Err ( e) = update_search_index ( & conn) {
225
225
error ! ( "Failed to update search index: {}" , e) ;
226
226
}
227
227
}
228
- } ) ;
228
+ } ) . unwrap ( ) ;
229
229
230
230
231
231
// update github stats every 6 hours
232
- thread:: spawn ( move || {
232
+ thread:: Builder :: new ( ) . name ( "github stat updater" . to_string ( ) ) . spawn ( move || {
233
233
loop {
234
234
thread:: sleep ( Duration :: from_secs ( 60 * 60 * 6 ) ) ;
235
235
if let Err ( e) = github_updater ( ) {
236
236
error ! ( "Failed to update github fields: {}" , e) ;
237
237
}
238
238
}
239
- } ) ;
239
+ } ) . unwrap ( ) ;
240
240
241
241
// TODO: update ssl certificate every 3 months
242
242
0 commit comments