Skip to content

Commit

Permalink
patch
Browse files Browse the repository at this point in the history
  • Loading branch information
lbr38 committed Dec 18, 2024
1 parent 9df3478 commit d727f00
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 23 deletions.
21 changes: 2 additions & 19 deletions src/controllers/Module/Reposerver/Agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,25 +90,8 @@ def on_inotify_change(self, ev):
if Path('/tmp/linupdate.update-running').is_file():
return

# If latest event was less than 120 seconds ago, then do not send again the history
# if self.last_inotify_event_time and time.time() - self.last_inotify_event_time < 120:
# return

# Define new last event time
# self.last_inotify_event_time = time.time()

# /var/log/dnf.log issue: wait before sending the history because it might have
# been triggered by another history sending (from a request from the Repomanager server for example) as
# even the 'dnf history' command is logged in the dnf.log file
# So just wait a bit to don't send both history at the same time...
# if self.log_file == '/var/log/dnf.log':
# time.sleep(15)

# Send the history
# print('[reposerver-agent] New event has been detected in ' + self.log_file + ' - sending history to the Repomanager server.')
# self.reposerverStatusController.send_packages_history()

print('[reposerver-agent] New event has been detected in ' + self.log_file + ' - triggering packages informations.')
# Message for debugging
# print('[reposerver-agent][debug] New event has been detected in ' + self.log_file + ' - triggering packages informations.')
Trigger().create('package-info')


Expand Down
2 changes: 1 addition & 1 deletion src/controllers/Package/Apt.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ def update(self, packagesList, exit_on_package_update_error: bool = True, dry_ru
sys.stdout.write('\r' + ' | ' + buffer.strip() + '\n')
sys.stdout.flush()

# TODO debug
# TODO: to test
# Deal with the carriage return of the last line
sys.stdout.write('\r')

Expand Down
7 changes: 4 additions & 3 deletions src/controllers/Package/Package.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,10 @@ def update(self, packages_list: list = [], assume_yes: bool = False, ignore_excl
}

try:
# Create a temporary file in /tmp to indicate that the update process is running
if not Path(update_running_file).is_file():
Path(update_running_file).touch()

# Retrieve configuration
configuration = self.appConfigController.get_conf()

Expand Down Expand Up @@ -283,9 +287,6 @@ def update(self, packages_list: list = [], assume_yes: bool = False, ignore_excl
self.remove_all_exclusions()
self.exitController.clean_exit(0, False)

# Create a temporary file in /tmp to indicate that the update process is running
Path(update_running_file).touch()

print('\n Updating packages...')

# If 'linupdate' is in the list of packages to update, then add a temporary file in /tmp to
Expand Down

0 comments on commit d727f00

Please sign in to comment.