-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Files health check with checksum match count (#7380)
* WIP, return checksum match counts this counts represent how many files are exactly the same * fix lint errors and improve performance
- Loading branch information
Showing
7 changed files
with
183 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
import { StoredFile } from '../model/StoredFile'; | ||
import { UwaziFile } from '../model/UwaziFile'; | ||
|
||
export interface FileStorage { | ||
list(): Promise<string[]>; | ||
list(): Promise<StoredFile[]>; | ||
getPath(file: UwaziFile): string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import path from 'path'; | ||
|
||
export class StoredFile { | ||
readonly filename: string; | ||
|
||
readonly fullPath: string; | ||
|
||
readonly checksum?: string; | ||
|
||
constructor(fullPath: string, checksum?: string) { | ||
this.filename = path.basename(fullPath); | ||
this.fullPath = fullPath; | ||
this.checksum = checksum; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.