@@ -28,7 +28,7 @@ opts = [
28
28
{:ok , conn} = Kino .start_child ({Postgrex , opts})
29
29
```
30
30
31
- <!-- livebook:{"attrs":{"cache_query":true,"connection":{"type":"postgres","variable":"conn"},"data_frame_alias":"Elixir.Explorer.DataFrame","query":"select id, payload ->> 'permanent_url' as url, inserted_at \nfrom resource_history rh\nwhere rh.resource_id = 79624 \norder by inserted_at asc","result_variable":"result","timeout":null},"chunks":null,"kind":"Elixir.KinoDB.SQLCell","livebook_object":"smart_cell"} -->
31
+ <!-- livebook:{"attrs":{"cache_query":true,"connection":{"type":"postgres","variable":"conn"},"data_frame_alias":"Elixir.Explorer.DataFrame","query":"select id, payload ->> 'permanent_url' as url, inserted_at \nfrom resource_history rh\nwhere rh.resource_id = 81623 \norder by inserted_at asc","result_variable":"result","timeout":null},"chunks":null,"kind":"Elixir.KinoDB.SQLCell","livebook_object":"smart_cell"} -->
32
32
33
33
``` elixir
34
34
result =
@@ -37,7 +37,7 @@ result =
37
37
"""
38
38
select id, payload ->> 'permanent_url' as url, inserted_at
39
39
from resource_history rh
40
- where rh.resource_id = 79624
40
+ where rh.resource_id = 81623
41
41
order by inserted_at asc
42
42
""" ,
43
43
[]
@@ -58,14 +58,14 @@ snapshots =
58
58
```
59
59
60
60
``` elixir
61
- path = Path .join (__ENV__ .file, " ../../scripts/irve/ req_custom_cache.exs " ) |> Path .expand ()
61
+ path = Path .join (__ENV__ .file, " ../../apps/shared/lib/ req_custom_cache.ex " ) |> Path .expand ()
62
62
Code .require_file (path)
63
63
64
64
defmodule Query do
65
65
def cache_dir , do: Path .join (__ENV__ .file, " ../cache-dir" ) |> Path .expand ()
66
66
67
67
def cached_get! (url) do
68
- req = Req .new () |> CustomCache .attach ()
68
+ req = Req .new () |> Transport . Shared . ReqCustomCache .attach ()
69
69
Req .get! (req, url: url, receive_timeout: 100_000 , custom_cache_dir: cache_dir ())
70
70
end
71
71
end
87
87
task,
88
88
max_concurrency: 25 ,
89
89
on_timeout: :kill_task ,
90
- timeout: 25_000
90
+ timeout: 50_000
91
91
)
92
92
|> Stream .map (fn {:ok , result} -> result end )
93
93
|> Stream .map (fn x -> Map .take (x, [" inserted_at" , " row_count" ]) end )
0 commit comments