Skip to content

Commit 0fa55d0

Browse files
committed
Remove realtime compiler server proxy caching
This causes issues when using different Hyde binaries in different locations. Just wasted half an hour finding out that the reason my code didn't change was because the server proxy was generated with the global version and thus used that archive's code, instead of the development build in my parent directory. This change makes to that the proxy is regenerated each time the server starts, which should not have any real performance impact, especially since it is just when the serve command is run.
1 parent 73fba41 commit 0fa55d0

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

app/Commands/ServeCommand.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@ protected function proxyPharServer(): string
2929
{
3030
$path = HYDE_TEMP_DIR.'/bin/server.php';
3131

32-
if (File::exists($path)) {
33-
return $path;
34-
}
35-
3632
$this->createServer($path);
3733

3834
return $path;

tests/Unit/ServeCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
test('getExecutablePath method proxies server executable', function () {
1313
HydeKernel::setInstance(new HydeKernel(HYDE_WORKING_DIR));
14-
File::shouldReceive('exists')->twice()->andReturnFalse();
14+
File::shouldReceive('exists')->once()->andReturnFalse();
1515
File::shouldReceive('ensureDirectoryExists')->once()->with('/path/to/temp/dir/bin');
1616
File::shouldReceive('put')->once()->withArgs(function ($path, $contents) {
1717
expect($path)->toBe('/path/to/temp/dir/bin/server.php')

0 commit comments

Comments
 (0)