Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
StackExchange.Redis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tsai
StackExchange.Redis
Commits
ddbcdb83
Commit
ddbcdb83
authored
Apr 30, 2017
by
Marc Gravell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add .ConfigureAwait(false) throughout; still wondering if I even need Client, though...
parent
52bf5d6c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
Client.cs
NRediSearch/Client.cs
+8
-8
No files found.
NRediSearch/Client.cs
View file @
ddbcdb83
...
@@ -101,7 +101,7 @@ public async Task<bool> CreateIndexAsync(Schema schema, IndexOptions options)
...
@@ -101,7 +101,7 @@ public async Task<bool> CreateIndexAsync(Schema schema, IndexOptions options)
f
.
SerializeRedisArgs
(
args
);
f
.
SerializeRedisArgs
(
args
);
}
}
return
(
string
)
await
_db
.
ExecuteAsync
(
"FT.CREATE"
,
args
)
==
"OK"
;
return
(
string
)
await
_db
.
ExecuteAsync
(
"FT.CREATE"
,
args
)
.
ConfigureAwait
(
false
)
==
"OK"
;
}
}
/// <summary>
/// <summary>
...
@@ -130,7 +130,7 @@ public async Task<SearchResult> SearchAsync(Query q)
...
@@ -130,7 +130,7 @@ public async Task<SearchResult> SearchAsync(Query q)
args
.
Add
(
_boxedIndexName
);
args
.
Add
(
_boxedIndexName
);
q
.
SerializeRedisArgs
(
args
);
q
.
SerializeRedisArgs
(
args
);
var
resp
=
(
RedisResult
[])
await
_db
.
ExecuteAsync
(
"FT.SEARCH"
,
args
);
var
resp
=
(
RedisResult
[])
await
_db
.
ExecuteAsync
(
"FT.SEARCH"
,
args
)
.
ConfigureAwait
(
false
)
;
return
new
SearchResult
(
resp
,
!
q
.
NoContent
,
q
.
WithScores
,
q
.
WithPayloads
);
return
new
SearchResult
(
resp
,
!
q
.
NoContent
,
q
.
WithScores
,
q
.
WithPayloads
);
}
}
...
@@ -161,7 +161,7 @@ public bool AddDocument(string docId, Dictionary<string, RedisValue> fields, dou
...
@@ -161,7 +161,7 @@ public bool AddDocument(string docId, Dictionary<string, RedisValue> fields, dou
public
async
Task
<
bool
>
AddDocumentAsync
(
string
docId
,
Dictionary
<
string
,
RedisValue
>
fields
,
double
score
=
1.0
,
bool
noSave
=
false
,
bool
replace
=
false
,
byte
[]
payload
=
null
)
public
async
Task
<
bool
>
AddDocumentAsync
(
string
docId
,
Dictionary
<
string
,
RedisValue
>
fields
,
double
score
=
1.0
,
bool
noSave
=
false
,
bool
replace
=
false
,
byte
[]
payload
=
null
)
{
{
var
args
=
BuildAddDocumentArgs
(
docId
,
fields
,
score
,
noSave
,
replace
,
payload
);
var
args
=
BuildAddDocumentArgs
(
docId
,
fields
,
score
,
noSave
,
replace
,
payload
);
return
(
string
)
await
_db
.
ExecuteAsync
(
"FT.ADD"
,
args
)
==
"OK"
;
return
(
string
)
await
_db
.
ExecuteAsync
(
"FT.ADD"
,
args
)
.
ConfigureAwait
(
false
)
==
"OK"
;
}
}
private
List
<
object
>
BuildAddDocumentArgs
(
string
docId
,
Dictionary
<
string
,
RedisValue
>
fields
,
double
score
,
bool
noSave
,
bool
replace
,
byte
[]
payload
)
private
List
<
object
>
BuildAddDocumentArgs
(
string
docId
,
Dictionary
<
string
,
RedisValue
>
fields
,
double
score
,
bool
noSave
,
bool
replace
,
byte
[]
payload
)
...
@@ -233,7 +233,7 @@ public async Task<bool> AddHashAsync(string docId, double score, bool replace)
...
@@ -233,7 +233,7 @@ public async Task<bool> AddHashAsync(string docId, double score, bool replace)
{
{
args
.
Add
(
"REPLACE"
.
Literal
());
args
.
Add
(
"REPLACE"
.
Literal
());
}
}
return
(
string
)
await
_db
.
ExecuteAsync
(
"FT.ADDHASH"
,
args
)
==
"OK"
;
return
(
string
)
await
_db
.
ExecuteAsync
(
"FT.ADDHASH"
,
args
)
.
ConfigureAwait
(
false
)
==
"OK"
;
}
}
/// <summary>
/// <summary>
...
@@ -252,7 +252,7 @@ public async Task<bool> AddHashAsync(string docId, double score, bool replace)
...
@@ -252,7 +252,7 @@ public async Task<bool> AddHashAsync(string docId, double score, bool replace)
/// <returns>a map of key/value pairs</returns>
/// <returns>a map of key/value pairs</returns>
public
async
Task
<
Dictionary
<
string
,
RedisValue
>>
GetInfoAsync
()
public
async
Task
<
Dictionary
<
string
,
RedisValue
>>
GetInfoAsync
()
{
{
return
ParseGetInfo
(
await
_db
.
ExecuteAsync
(
"FT.INFO"
,
_boxedIndexName
));
return
ParseGetInfo
(
await
_db
.
ExecuteAsync
(
"FT.INFO"
,
_boxedIndexName
)
.
ConfigureAwait
(
false
)
);
}
}
static
Dictionary
<
string
,
RedisValue
>
ParseGetInfo
(
RedisResult
value
)
static
Dictionary
<
string
,
RedisValue
>
ParseGetInfo
(
RedisResult
value
)
{
{
...
@@ -284,7 +284,7 @@ public bool DeleteDocument(string docId)
...
@@ -284,7 +284,7 @@ public bool DeleteDocument(string docId)
/// <returns>true if it has been deleted, false if it did not exist</returns>
/// <returns>true if it has been deleted, false if it did not exist</returns>
public
async
Task
<
bool
>
DeleteDocumentAsync
(
string
docId
)
public
async
Task
<
bool
>
DeleteDocumentAsync
(
string
docId
)
{
{
return
(
long
)
await
_db
.
ExecuteAsync
(
"FT.DEL"
,
_boxedIndexName
,
docId
)
==
1
;
return
(
long
)
await
_db
.
ExecuteAsync
(
"FT.DEL"
,
_boxedIndexName
,
docId
)
.
ConfigureAwait
(
false
)
==
1
;
}
}
/// <summary>
/// <summary>
...
@@ -301,7 +301,7 @@ public bool DropIndex()
...
@@ -301,7 +301,7 @@ public bool DropIndex()
/// <returns>true on success</returns>
/// <returns>true on success</returns>
public
async
Task
<
bool
>
DropIndexAsync
()
public
async
Task
<
bool
>
DropIndexAsync
()
{
{
return
(
string
)
await
_db
.
ExecuteAsync
(
"FT.DROP"
,
_boxedIndexName
)
==
"OK"
;
return
(
string
)
await
_db
.
ExecuteAsync
(
"FT.DROP"
,
_boxedIndexName
)
.
ConfigureAwait
(
false
)
==
"OK"
;
}
}
/// <summary>
/// <summary>
...
@@ -317,7 +317,7 @@ public long OptimizeIndex()
...
@@ -317,7 +317,7 @@ public long OptimizeIndex()
/// </summary>
/// </summary>
public
async
Task
<
long
>
OptimizeIndexAsync
()
public
async
Task
<
long
>
OptimizeIndexAsync
()
{
{
return
(
long
)
await
_db
.
ExecuteAsync
(
"FT.OPTIMIZE"
,
_boxedIndexName
);
return
(
long
)
await
_db
.
ExecuteAsync
(
"FT.OPTIMIZE"
,
_boxedIndexName
)
.
ConfigureAwait
(
false
)
;
}
}
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment