fix: forgot to complete inner pipe
This commit is contained in:
parent
0206cc8ad6
commit
9920d21ad8
1 changed files with 3 additions and 2 deletions
|
|
@ -67,8 +67,6 @@ app.MapPost("/api/image/generate", (Stitch request, IMemoryCache cache) =>
|
|||
if( value is string path )
|
||||
File.Delete(path);
|
||||
});
|
||||
logger.ZLogDebug($"save cache key: {cacheKey}, file: {newCacheFile}");
|
||||
cache.Set(cacheKey!, newCacheFile, cacheEntryOptions);
|
||||
|
||||
await using FileStream cacheStream = new(newCacheFile, FileMode.Create, FileAccess.Write, FileShare.Read);
|
||||
while( true )
|
||||
|
|
@ -83,8 +81,11 @@ app.MapPost("/api/image/generate", (Stitch request, IMemoryCache cache) =>
|
|||
if( result.IsCompleted )
|
||||
break;
|
||||
}
|
||||
logger.ZLogDebug($"save cache key: {cacheKey}, file: {newCacheFile}");
|
||||
cache.Set(cacheKey, newCacheFile, cacheEntryOptions);
|
||||
});
|
||||
image?.WriteToStream(innerPipe.Writer.AsStream(), ".png");
|
||||
await innerPipe.Writer.CompleteAsync();
|
||||
}
|
||||
catch( Exception e )
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue