This repository has been archived by the owner on Dec 24, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 876
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
46 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using System; | ||
using System.Threading; | ||
using ServiceStack; | ||
using ServiceStack.Logging; | ||
using ServiceStack.Redis; | ||
|
||
namespace ConsoleTests; | ||
|
||
class DbSelectConnectionStringIssue | ||
{ | ||
public void Execute() | ||
{ | ||
LogManager.LogFactory = new ConsoleLogFactory(); | ||
|
||
Licensing.RegisterLicense("<removed>"); | ||
|
||
var redisManagerPool = new RedisManagerPool("redis://redisHost?db=7"); | ||
|
||
for (int i = 0; i < 5; i++) | ||
{ | ||
try | ||
{ | ||
using (IRedisClient client = redisManagerPool.GetClient()) | ||
{ | ||
string value = client.GetValue("status"); | ||
|
||
Console.WriteLine($"Successfully retrieved value => '{value}'"); | ||
} | ||
} | ||
catch (Exception ex) | ||
{ | ||
Console.WriteLine($"Exception handled \n{ex}"); | ||
} | ||
|
||
Console.WriteLine("Sleeping for 25 seconds to allow client to be garbage collected"); | ||
Thread.Sleep(TimeSpan.FromSeconds(25)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters