File tree Expand file tree Collapse file tree 3 files changed +16
-5
lines changed
frontend/src/components/user-profile Expand file tree Collapse file tree 3 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -66,7 +66,10 @@ export class QueueController {
6666 @Post ( 'recalculateHashes' )
6767 @AdminOnly ( )
6868 @OutputDto ( null )
69- async recalculateHashes ( ) : Promise < void > {
69+ async recalculateHashes ( ) : Promise < {
70+ success : boolean ;
71+ fileCount : number ;
72+ } > {
7073 return await this . queueService . recalculateHashes ( ) ;
7174 }
7275
Original file line number Diff line number Diff line change @@ -167,9 +167,12 @@ export class QueueService implements OnModuleInit {
167167 /**
168168 * re-caluclates the hashes for all files without a valid hash
169169 */
170- async recalculateHashes ( ) : Promise < void > {
170+ async recalculateHashes ( ) : Promise < {
171+ success : boolean ;
172+ fileCount : number ;
173+ } > {
171174 const files = await this . fileRepository . find ( {
172- where : { hash : '' } ,
175+ where : { hash : '' , state : FileState . OK } ,
173176 relations : [ 'mission' , 'mission.project' ] ,
174177 } ) ;
175178
@@ -185,6 +188,11 @@ export class QueueService implements OnModuleInit {
185188 logger . error ( error ) ;
186189 }
187190 }
191+
192+ return {
193+ success : true ,
194+ fileCount : files . length ,
195+ } ;
188196 }
189197
190198 async confirmUpload ( uuid : string , md5 : string ) : Promise < void > {
Original file line number Diff line number Diff line change @@ -74,10 +74,10 @@ async function resetFileSizes(): Promise<void> {
7474}
7575
7676async function recalculateHashes(): Promise <void > {
77- await axios .post (' queue/recalculateHashes' );
77+ const { data } = await axios .post (' queue/recalculateHashes' );
7878
7979 $q .notify ({
80- message: ' Hash recalculation started' ,
80+ message: ` Recalculating hashes started. ${ data . fileCount } files to process ` ,
8181 color: ' positive' ,
8282 position: ' bottom' ,
8383 timeout: 2000 ,
You can’t perform that action at this time.
0 commit comments