Move session to top of file.
This commit is contained in:
parent
c0a59059f5
commit
b16c096dfb
1 changed files with 3 additions and 3 deletions
|
@ -20,6 +20,9 @@ HEADERS = {
|
||||||
'User-Agent': f'voussoir/hnarchive v{VERSION}.',
|
'User-Agent': f'voussoir/hnarchive v{VERSION}.',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
session = requests.Session()
|
||||||
|
session.headers.update(HEADERS)
|
||||||
|
|
||||||
DB_INIT = '''
|
DB_INIT = '''
|
||||||
PRAGMA user_version = 1;
|
PRAGMA user_version = 1;
|
||||||
CREATE TABLE IF NOT EXISTS items(
|
CREATE TABLE IF NOT EXISTS items(
|
||||||
|
@ -67,9 +70,6 @@ def int_or_none(x):
|
||||||
|
|
||||||
# API ##############################################################################################
|
# API ##############################################################################################
|
||||||
|
|
||||||
session = requests.Session()
|
|
||||||
session.headers.update(HEADERS)
|
|
||||||
|
|
||||||
def get(url, retries=1):
|
def get(url, retries=1):
|
||||||
start_time = time.time()
|
start_time = time.time()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue