Skip to content

Commit

Permalink
change lftp call to avoid hanging
Browse files Browse the repository at this point in the history
  • Loading branch information
doriankodelja-se committed Nov 21, 2024
1 parent 89efdd9 commit 95f74ba
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: coverage-report
path: ${{github.workspace}}/htmlcov
6 changes: 4 additions & 2 deletions ecodev_core/backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,10 @@ def _get_old_backups(file_to_backup: Path, nb_saves: int) -> List[str]:
"""
Retrieve old versions of file_to_backup in order to erase them (more than nb_saves ago)
"""
output = run(['lftp', '-c', f'open {BACKUP_URL}; ls {file_to_backup.name.split(".")[0]}*'],
output = run(['lftp', '-c', f'open {BACKUP_URL}; ls'],
capture_output=True, text=True)
all_backups = sorted([x.split(' ')[-1] for x in output.stdout.splitlines()])
filename_base = file_to_backup.name.split('.')[0]
all_backups = sorted([x.split(' ')[-1]
for x in output.stdout.splitlines() if filename_base in x])
log.info(f'existing remote backups {all_backups}')
return all_backups[:-nb_saves]

0 comments on commit 95f74ba

Please sign in to comment.