@@ -13,19 +13,21 @@ defmodule Zebra.Workers.JobRequestFactory.Cache do
13
13
# Overall, if cache system is down, we ignore every issue.
14
14
#
15
15
16
- def find ( nil , _repo_proxy ) do
16
+ def find ( nil , _repo_proxy , _org_id ) do
17
17
# We don't fail any jobs due to a missing cache connection,
18
18
# but we should make sure we are aware of any issues in this area.
19
19
Watchman . increment ( "external.cachehub.describe.failed" )
20
20
21
21
{ :ok , nil }
22
22
end
23
23
24
- def find ( cache_id , repo_proxy ) do
24
+ def find ( cache_id , repo_proxy , org_id ) do
25
25
Watchman . benchmark ( "external.cachehub.describe" , fn ->
26
26
req = Request . new ( cache_id: cache_id )
27
27
28
- with false <- forked_pr? ( repo_proxy ) ,
28
+ with false <-
29
+ forked_pr? ( repo_proxy ) and
30
+ FeatureProvider . feature_enabled? ( :disable_forked_pr_cache , param: org_id ) ,
29
31
{ :ok , endpoint } <- Application . fetch_env ( :zebra , :cachehub_api_endpoint ) ,
30
32
{ :ok , channel } <- GRPC.Stub . connect ( endpoint ) ,
31
33
{ :ok , response } <- Stub . describe ( channel , req , timeout: 30_000 ) do
@@ -40,7 +42,10 @@ defmodule Zebra.Workers.JobRequestFactory.Cache do
40
42
end
41
43
else
42
44
true ->
43
- Logger . info ( "Skipping fetching of the cache as the job is part of Forked PR build." )
45
+ Logger . info (
46
+ "Skipping fetching of the cache as the job is part of Forked PR build. Cache id #{ inspect ( cache_id ) } "
47
+ )
48
+
44
49
{ :ok , nil }
45
50
46
51
e ->
0 commit comments