tgstation-server 6.12.0
The /tg/station 13 server suite
Loading...
Searching...
No Matches
SymlinkDmbProvider.cs
Go to the documentation of this file.
1using System.Threading;
2using System.Threading.Tasks;
3
5
7{
12 {
20 IDmbProvider baseProvider,
21 IIOManager ioManager,
22 IFilesystemLinkFactory linkFactory)
23 : base(baseProvider, ioManager, linkFactory)
24 {
25 }
26
28 public override Task FinishActivationPreparation(CancellationToken cancellationToken) => Task.CompletedTask;
29
31 protected override async ValueTask DoSwap(CancellationToken cancellationToken)
32 {
34 await IOManager.DeleteFile(LiveGameDirectory, cancellationToken);
35 else
36 await IOManager.DeleteDirectory(LiveGameDirectory, cancellationToken);
37
41 cancellationToken);
42 }
43 }
44}
A IDmbProvider that uses filesystem links to change directory structure underneath the server process...
IDmbProvider BaseProvider
The IDmbProvider we are swapping for.
const string LiveGameDirectory
The directory where the BaseProvider is symlinked to.
IFilesystemLinkFactory LinkFactory
The IFilesystemLinkFactory to use.
Provides absolute paths to the latest compiled .dmbs.
Interface for using filesystems.
Definition IIOManager.cs:13
string ResolvePath()
Retrieve the full path of the current working directory.
Task DeleteFile(string path, CancellationToken cancellationToken)
Deletes a file at path .
Task DeleteDirectory(string path, CancellationToken cancellationToken)
Recursively delete a directory, removes and does not enter any symlinks encounterd.