Skip to content

Commit

Permalink
examples: limit news_fetcher.v
Browse files Browse the repository at this point in the history
  • Loading branch information
medvednikov committed May 23, 2024
1 parent 115ecdd commit 27833e0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion examples/news_fetcher.v
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ fn worker_fetch(mut p pool.PoolProcessor, cursor int, worker_id int) voidptr {
}
story := json2.decode[Story](resp.body) or {
println('failed to decode a story')
// println(resp.body)
return pool.no_result
}
println('# ${cursor}) ${story.title} | ${story.url}')
Expand All @@ -37,7 +38,7 @@ fn main() {
return
}#[0..10]
*/
ids := resp.body.replace_once('[', '').replace_once(']', '').split(',').map(it.int())
ids := resp.body.replace_once('[', '').replace_once(']', '').split(',').map(it.int())#[0..10]
mut fetcher_pool := pool.new_pool_processor(
callback: worker_fetch
)
Expand Down

0 comments on commit 27833e0

Please sign in to comment.