@@ -229,16 +229,16 @@ function retryCompilationTask(
229229 projectDir : string ,
230230 dependencyGraph : CdsDependencyGraph ,
231231) : CompilationAttempt {
232- const attemptId = `${ task . id } _retry_${ Date . now ( ) } _${ Math . random ( ) . toString ( 36 ) . substr ( 2 , 5 ) } ` ;
233232 const startTime = new Date ( ) ;
233+ const attemptId = `${ task . id } _retry_${ startTime . getTime ( ) } ` ;
234234
235- // Use the original command string for consistency with existing compilation logic
235+ // Use the original command string for consistency with existing compilation logic.
236236 const cdsCommandString = retryCommand . originalCommand ;
237237
238238 const attempt : CompilationAttempt = {
239239 id : attemptId ,
240240 cdsCommand : cdsCommandString ,
241- cacheDir : projectDir , // For retry, we use the project directory
241+ cacheDir : projectDir ,
242242 timestamp : startTime ,
243243 result : {
244244 success : false ,
@@ -247,14 +247,14 @@ function retryCompilationTask(
247247 } ;
248248
249249 try {
250- // Use the same compilation logic as the original attempt
250+ // Use the same compilation logic as the original attempt.
251251 const primarySourceFile = task . sourceFiles [ 0 ] ;
252252
253253 const compilationResult = compileCdsToJson (
254254 primarySourceFile ,
255255 dependencyGraph . sourceRootDir ,
256256 cdsCommandString ,
257- projectDir , // Use project directory instead of cache directory for retry
257+ projectDir ,
258258 // Convert CDS projects to BasicCdsProject format expected by compileCdsToJson
259259 new Map (
260260 Array . from ( dependencyGraph . projects . entries ( ) ) . map ( ( [ key , value ] ) => [
@@ -288,11 +288,11 @@ function retryCompilationTask(
288288}
289289
290290/**
291- * Executes retry compilation for specific tasks
291+ * Executes retries for the provided array of { @link CompilationTask} instances.
292292 * @param tasksToRetry Tasks that need to be retried
293- * @param project The project containing the tasks
294- * @param dependencyGraph The dependency graph
295- * @returns Retry execution results
293+ * @param project The { @link CdsProject} associated with the compilation tasks to retry
294+ * @param dependencyGraph The { @link CdsDependencyGraph} to update as tasks are retried
295+ * @returns The { @link ResultRetryCompilationTask}
296296 */
297297function retryCompilationTasksForProject (
298298 tasksToRetry : CompilationTask [ ] ,
0 commit comments