Skip to content

Commit

Permalink
Merge pull request #59 from HPCNow/main
Browse files Browse the repository at this point in the history
froster v0.12.15 - Froster configuration tests done
  • Loading branch information
victormachadoperez authored Jun 7, 2024
2 parents ba47f19 + 72f4dd7 commit f54f39f
Show file tree
Hide file tree
Showing 3 changed files with 281 additions and 17 deletions.
16 changes: 7 additions & 9 deletions froster/froster.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def __init__(self):
self.aws_init = True

# Last timestamp we checked for an updated
self.update_check_timestamp = config.get(
self.last_timestamp = config.getint(
'UPDATE', 'timestamp', fallback=None)

# Shared configuration
Expand Down Expand Up @@ -982,7 +982,7 @@ def set_shared(self):

# Ask user if they want to move the local list of files and directories that were archived to the shared directory
local_froster_archives_to_shared = inquirer.confirm(
message="Do you want to move the local list of files and directories that were archived to the shared directory?", default=True)
message="Do you want to copy the local list of files and directories that were archived to the shared directory?", default=True)

# Move the local froster archives to shared directory
if local_froster_archives_to_shared:
Expand Down Expand Up @@ -1200,20 +1200,18 @@ def check_update(self):
'''Set the update check'''

try:
timestamp = time.time()
timestamp = int(time.time())

if hasattr(self, 'update_check_timestamp') and self.update_check_timestamp is not None:
if hasattr(self, 'last_timestamp') and self.last_timestamp is not None:
# Check if last day was less than 86400 * 7 = (1 day) * 7 = 1 week
print(timestamp)
print(self.update_check_timestamp)
print(timestamp - self.update_check_timestamp)
if timestamp - self.update_check_timestamp < (86400*7):
if timestamp - self.last_timestamp < (86400*7):
# Less than a week since last check
return False

# Set the update check flag in the config file
self.__set_configuration_entry(
'UPDATE', 'update_check_timestamp', timestamp)
'UPDATE', 'timestamp', timestamp)

return True

except Exception:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "froster"
version = "0.12.14"
version = "0.12.15"
description = "Froster is a tool for easy data transfer between local file systems and AWS S3 storage."
authors = ["Victor Machado <[email protected]>"]
readme = "README.md"
Expand Down
Loading

0 comments on commit f54f39f

Please sign in to comment.