Skip to content

Commit 1ad6843

Browse files
committed
Fix ins_not_login get error
1 parent fc35bb0 commit 1ad6843

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

lib/instaghub_web/controllers/page_controller.ex

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ defmodule InstaghubWeb.PageController do
77
alias Instaghub.Utils
88
require Logger
99

10-
@ins_not_login System.get_env("INS_NOT_LOGIN")
11-
1210
defp before_halt(conn, ua_type) do
1311
Logger.debug "before halt we will decrease req #{ua_type}"
1412
Instaghub.Bucket.decrease_req(ua_type)
@@ -109,7 +107,7 @@ defmodule InstaghubWeb.PageController do
109107
if is_4xx(feeds_with_page) do
110108
handle_4xx(conn, feeds_with_page)
111109
else
112-
if @ins_not_login == "1" do
110+
if System.get_env("INS_NOT_LOGIN") == "1" do
113111
get_tag(conn, feeds_with_page, cursor)
114112
else
115113
get_index(conn, path, feeds_with_page, cursor)

lib/instagram/ins_web_api.ex

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ defmodule Ins.Web.API do
1010
@tag_hash "f92f56d47dc7a55b606908374b43a314"
1111
@post_hash "477b65a610463740ccdb83135b2014db"
1212

13-
@ins_not_login System.get_env("INS_NOT_LOGIN")
1413
@csrf "csrf"
1514
@rhx_gis "rhx_gis"
1615

@@ -29,7 +28,7 @@ defmodule Ins.Web.API do
2928
end
3029

3130
def get_feeds(cursor \\ nil, menu \\ :sports) do
32-
if @ins_not_login == "1" do
31+
if System.get_env("INS_NOT_LOGIN") == "1" do
3332
get_not_login_feeds(cursor, menu)
3433
else
3534
get_login_feeds(cursor, menu)
@@ -167,7 +166,7 @@ defmodule Ins.Web.API do
167166
end
168167

169168
defp generate_header(params) do
170-
if @ins_not_login == "1" do
169+
if System.get_env("INS_NOT_LOGIN") == "1" do
171170
get_not_login_header(params)
172171
else
173172
get_login_header(params)

0 commit comments

Comments
 (0)