Skip to content

Commit

Permalink
Lint error fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mandarons committed Aug 29, 2023
1 parent 19de9bc commit 919c664
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -442,5 +442,5 @@ valid-metaclass-classmethod-first-arg=mcs

# Exceptions that will emit a warning when being caught. Defaults to
# "Exception"
overgeneral-exceptions=StandardError,
BaseException
overgeneral-exceptions=builtins.StandardError,
builtins.BaseException
8 changes: 4 additions & 4 deletions src/usage.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def load_cache(file_path: str):
"""Load the cache file."""
data = {}
if os.path.isfile(file_path):
with open(file_path) as f:
with open(file_path, encoding="utf-8") as f:
data = json.load(f)
else:
save_cache(file_path=file_path, data={})
Expand All @@ -35,15 +35,15 @@ def load_cache(file_path: str):

def save_cache(file_path: str, data: object):
"""Save data to the cache file."""
with open(file_path, "w") as f:
with open(file_path, "w", encoding="utf-8") as f:
json.dump(data, f)
return True


def post_new_installation(data, endpoint=NEW_INSTALLATION_ENDPOINT):
"""Post new installation to server."""
try:
response = requests.post(endpoint, data)
response = requests.post(endpoint, data, timeout=10000)
if response.ok:
data = response.json()
return data["id"]
Expand Down Expand Up @@ -82,7 +82,7 @@ def install(cached_data):
def post_new_heartbeat(data, endpoint=NEW_HEARTBEAT_ENDPOINT):
"""Post the heartbeat to server."""
try:
response = requests.post(endpoint, data)
response = requests.post(endpoint, data, timeout=10000)
if response.ok:
return True
except Exception:
Expand Down

0 comments on commit 919c664

Please sign in to comment.