feat: replace Hangfire with Coravel
This commit is contained in:
		
							parent
							
								
									ef221b2c45
								
							
						
					
					
						commit
						0aadc5fb47
					
				
					 19 changed files with 305 additions and 309 deletions
				
			
		
							
								
								
									
										33
									
								
								Foxnouns.Backend/Services/ObjectStorageService.cs
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										33
									
								
								Foxnouns.Backend/Services/ObjectStorageService.cs
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,33 @@ | |||
| using Minio; | ||||
| using Minio.DataModel.Args; | ||||
| using Minio.Exceptions; | ||||
| 
 | ||||
| namespace Foxnouns.Backend.Services; | ||||
| 
 | ||||
| public class ObjectStorageService(ILogger logger, Config config, IMinioClient minio) | ||||
| { | ||||
|     private readonly ILogger _logger = logger.ForContext<ObjectStorageService>(); | ||||
|      | ||||
|     public async Task RemoveObjectAsync(string path) | ||||
|     { | ||||
|         logger.Debug("Deleting object at path {Path}", path); | ||||
|         try | ||||
|         { | ||||
|             await minio.RemoveObjectAsync(new RemoveObjectArgs().WithBucket(config.Storage.Bucket).WithObject(path)); | ||||
|         } | ||||
|         catch (InvalidObjectNameException) | ||||
|         { | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     public async Task PutObjectAsync(string path, Stream data, string contentType) | ||||
|     { | ||||
|         await minio.PutObjectAsync(new PutObjectArgs() | ||||
|             .WithBucket(config.Storage.Bucket) | ||||
|             .WithObject(path) | ||||
|             .WithObjectSize(data.Length) | ||||
|             .WithStreamData(data) | ||||
|             .WithContentType(contentType) | ||||
|         ); | ||||
|     } | ||||
| } | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue