• George Koltsov's avatar
    Fix unintentional cleanup of Import/Export tmp files · 45f991a1
    George Koltsov authored
      - ImportExportCleanUpService's primary purpose is to delete
        export archive tar.gz file from object storage after 24 hours
        as well as any not cleaned up export files from tmp
        storage location
      - There is, however, a bug that can remove other projects'
        import files from tmp storage location unintentionally
      - This is happening due to the fact that an import request
        can have a tar.gz file that is more than 24 hours old,
        and because we use `find` system call that includes all
        files that are older than 24 hours, not being scoped to a
        specific project, it will pick up and remove other projects
        import files that happen to be old, regardless if the actual
        import attempt is recent or in progress
      - Such behaviour can be disruptive to project imports
      - Instead of deleting all files that are 24 hours old, scope
        `find` command to locate old files more accurately, not taking
        files from tar.gz into consideration
      - Also add logging for additional observability
    
    Changelog: fixed
    45f991a1
shared_spec.rb 2.26 KB