Skip to content

Commit fc7e389

Browse files
committed
fix: refs to cloud functions
1 parent 91f854d commit fc7e389

File tree

3 files changed

+20
-9
lines changed

3 files changed

+20
-9
lines changed

lib/algora/cloud.ex

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,18 @@ defmodule Algora.Cloud do
2121
call(AlgoraCloud, :count_matches, [job])
2222
end
2323

24+
def list_heatmaps(user_ids) do
25+
call(AlgoraCloud.Profiles, :list_heatmaps, [user_ids])
26+
end
27+
28+
def sync_heatmap_by(opts \\ []) do
29+
call(AlgoraCloud.Profiles, :sync_heatmap_by, [opts])
30+
end
31+
32+
def count_top_matches(opts \\ []) do
33+
call(AlgoraCloud, :count_top_matches, [opts])
34+
end
35+
2436
def get_contribution_score(job, user, contributions_map) do
2537
call(AlgoraCloud, :get_contribution_score, [job, user, contributions_map])
2638
end

lib/algora/settings/settings.ex

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ defmodule Algora.Settings do
104104

105105
def get_job_matches(job, opts \\ []) do
106106
limit = Keyword.get(opts, :limit, 1000)
107-
107+
108108
case get("job_matches:#{job.id}") do
109109
%{"matches" => matches} when is_list(matches) ->
110110
matches
@@ -122,7 +122,7 @@ defmodule Algora.Settings do
122122
_ -> [{"solver", true}]
123123
end
124124
]
125-
|> AlgoraCloud.list_top_matches()
125+
|> Algora.Cloud.list_top_matches()
126126
|> load_matches_2()
127127
end
128128
end
@@ -133,16 +133,15 @@ defmodule Algora.Settings do
133133
length(matches)
134134

135135
_ ->
136-
[
136+
Algora.Cloud.count_top_matches(
137137
tech_stack: job.tech_stack,
138138
email_required: true,
139139
sort_by:
140140
case get_job_criteria(job) do
141141
criteria when map_size(criteria) > 0 -> criteria
142142
_ -> [{"solver", true}]
143143
end
144-
]
145-
|> AlgoraCloud.count_top_matches()
144+
)
146145
end
147146
end
148147

@@ -153,7 +152,7 @@ defmodule Algora.Settings do
153152
limit: 50,
154153
sort_by: get_job_criteria(job)
155154
]
156-
|> AlgoraCloud.list_top_stargazers()
155+
|> Algora.Cloud.list_top_stargazers()
157156
|> load_matches_2()
158157
end
159158

lib/algora_web/live/org/job_live.ex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ defmodule AlgoraWeb.Org.JobLive do
624624
heatmaps_map =
625625
developers
626626
|> Enum.map(& &1.id)
627-
|> AlgoraCloud.Profiles.list_heatmaps()
627+
|> Algora.Cloud.list_heatmaps()
628628
|> Map.new(fn heatmap -> {heatmap.user_id, heatmap.data} end)
629629

630630
# Trigger async sync for missing heatmaps if connected (for all 12 matches)
@@ -648,7 +648,7 @@ defmodule AlgoraWeb.Org.JobLive do
648648
end)
649649
|> Enum.take(6)
650650

651-
truncated_matches = AlgoraCloud.truncate_matches(socket.assigns.current_org, sorted_matches)
651+
truncated_matches = Algora.Cloud.truncate_matches(socket.assigns.current_org, sorted_matches)
652652

653653
# Create a fake matches list with the right count for UI compatibility
654654
fake_matches = List.duplicate(%{}, total_matches_count)
@@ -665,7 +665,7 @@ defmodule AlgoraWeb.Org.JobLive do
665665
defp enqueue_heatmap_sync(users) do
666666
Task.start(fn ->
667667
for user <- users do
668-
AlgoraCloud.Profiles.sync_heatmap_by(id: user.id)
668+
Algora.Cloud.sync_heatmap_by(id: user.id)
669669
end
670670
end)
671671
end

0 commit comments

Comments
 (0)