Skip to content

Commit

Permalink
[BUGFIX] Fix problem of concurrent API calls in development mode brea…
Browse files Browse the repository at this point in the history
…k due to meta-data writing/loading is not "thread safe" (#103)
  • Loading branch information
kszymukowicz authored Sep 21, 2024
1 parent 697042c commit a537c1a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Classes/Service/SerializerMetadataService.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,12 @@ public static function generateAutoloadForClass(string $class): void
self::getMetadataFromMetadataDirs($reflectionClass->getName())
);

$tmpFile = $generatedMetadataFile . '.' . uniqid('', true);
file_put_contents(
$generatedMetadataFile,
$tmpFile,
Yaml::dump([$reflectionClass->getName() => $classMergedMetadata], 99)
);
rename($tmpFile, $generatedMetadataFile);

self::$runtimeGeneratedCache[] = $reflectionClass->getName();
}
Expand Down

0 comments on commit a537c1a

Please sign in to comment.