Skip to content

Commit aa56b8d

Browse files
calin-lupas_dsamcapscalin-lupas_dsamcaps
authored andcommitted
Rename SqlServer to SqlDb and update related files
This commit renames the `SqlServer` data store type to `SqlDb` across multiple files, including `ServiceExtensions.cs`, `DataStoreOptions.cs`, and `appsettings.json`. The changes ensure consistency in the switch statement for creating storage contexts and the enumeration for data store types. Additionally, comments in `RepositoryService.cs` and `TeamService.cs` have been updated to clarify the purpose of the `Task.Delay` calls, which are now standardized to a 5000 ms wait time.
1 parent 8b5ebf7 commit aa56b8d

5 files changed

Lines changed: 10 additions & 10 deletions

File tree

src/DevExcelerateApi/Core/Extensions/ServiceExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ private static IStorageContext<T> CreateStorageContext<T>(IServiceProvider sp) w
147147
{
148148
DataStoreOptions.DataStoreType.FileSystem => CreateFileSystemStorageContext<T>(dataStoreOptions.FileSystem),
149149
DataStoreOptions.DataStoreType.CosmosDb => CreateCosmosDbStorageContext<T>(dataStoreOptions.CosmosDb),
150-
DataStoreOptions.DataStoreType.SqlServer => CreateSqlServerStorageContext<T>(dataStoreOptions.SqlDb),
150+
DataStoreOptions.DataStoreType.SqlDb => CreateSqlServerStorageContext<T>(dataStoreOptions.SqlDb),
151151
_ => throw new InvalidOperationException($"Invalid 'DataStore' setting '{dataStoreOptions.Type}'.")
152152
};
153153
}

src/DevExcelerateApi/Core/Options/DataStoreOptions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ public enum DataStoreType
2121
/// </summary>
2222
CosmosDb,
2323
/// <summary>
24-
/// Represents a SQL Server data store.
24+
/// Represents a SQL DB data store.
2525
/// </summary>
26-
SqlServer
26+
SqlDb
2727
}
2828

2929
/// <summary>

src/DevExcelerateApi/Services/RepositoryService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,11 +402,11 @@ public async Task SaveRepository(PullRequestEvent pullRequestEvent)
402402
{
403403
repoRequest.RepositoryName = repoRequest.NewRepositoryName;
404404
}
405-
406-
await Task.Delay(5000); // Wait for the repository to be updated
407405
}
408406
}
409407

408+
await Task.Delay(5000); // Wait for the repository to be saved and available for further operations
409+
410410
// Step 2: Add the reader teams to the repo
411411
if (repoRequest.ReaderList?.Count > 0)
412412
{

src/DevExcelerateApi/Services/TeamService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ public async Task SaveTeam(PullRequestEvent pullRequestEvent)
373373
team = await installationClient.Organization.Team.Update(teamRequest.TeamOwner, teamRequest.TeamName, updateTeam);
374374
}
375375

376-
await Task.Delay(2000); // Wait for the team to be saved and available for further operations
376+
await Task.Delay(5000); // Wait for the team to be saved and available for further operations
377377

378378
// Step 2: Add members to the team
379379
if (teamRequest.MemberList?.Count > 0)

src/DevExcelerateApi/appsettings.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,18 @@
2727
}
2828
},
2929
"DataStore": {
30-
// FileSystem, CosmosDb, SqlServer
30+
// FileSystem, CosmosDb, SqlDb
3131
"Type": "",
3232
"FileSystem": {
3333
"FilePath": ""
34-
},
34+
},
3535
"CosmosDb": {
3636
"Database": "",
3737
// dotnet user-secrets set "DataStore:CosmosDb:ConnectionString" "MY_COSMOS_CONNECTION_STRING"
3838
"ConnectionString": ""
3939
},
40-
"SqlServer": {
41-
"ConnectionString": "" // dotnet user-secrets set "DataStore:SqlServer:ConnectionString" "MY_SQLSERVER_CONNECTION_STRING"
40+
"SqlDb": {
41+
"ConnectionString": "" // dotnet user-secrets set "DataStore:SqlDb:ConnectionString" "MY_SQLDB_CONNECTION_STRING"
4242
}
4343
},
4444
"feature_management": {

0 commit comments

Comments
 (0)