You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
defmoduleTeamsClusteringdo@fly_app_nameSystem.fetch_env!("LB_TEAMS_FLY_APP")@teams_cookieSystem.fetch_env!("LB_TEAMS_COOKIE")@app_server_envSystem.fetch_env!("LB_APP_SERVER_ENV")defcluster()doNode.set_cookie(teams_cookie())caseNode.connect(teams_node())dotrue->:ok_->{:error,"Tried to connect to #{inspect(teams_node())}"}endenddefteams_cookie,do: String.to_atom(@teams_cookie)defteams_node(),do: teams_node(@app_server_env)defpteams_node("dev"),do: :"[email protected]"defpteams_node(env)whenenvin["staging","prod"]do{:ok,[fly_machine|_]}=Fly.machines(@fly_app_name)ip=fly_machine["private_ip"]:"#{@fly_app_name}-#{image_id(fly_machine)}@#{ip}"enddefpimage_id(fly_machine)doimage_tag=fly_machine["image_ref"]["tag"][image_id]=Regex.run(~r/.*-(.*)/,image_tag,capture: :all_but_first)image_idendend
importKino.Shorts
clustering_flame=frame(placeholder: false)|>Kino.render()Kino.Frame.render(clustering_flame,"Connecting to Teams...")caseTeamsClustering.cluster()do:ok->Kino.Frame.render(clustering_flame,"Connected to Teams ✅"){:error,error_message}->Kino.Frame.clear(clustering_flame)error_message=Kino.Text.new("Problem while connecting to Teams: #{error_message}",style: [color: "red"])Kino.render(error_message)Kino.interrupt!(:error,"Try again?")end