Skip to content

Commit 652c212

Browse files
committed
Fix incompatibility with new redis.OM and dragonfly
1 parent f7a39ad commit 652c212

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

Common/Redis/DeviceOnline.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ public sealed class DeviceOnline
1010
{
1111
public const string IndexName = "device-online";
1212

13-
[RedisIdField] [Indexed] public required Guid Id { get; set; }
14-
[Indexed] public required Guid Owner { get; set; }
13+
[RedisIdField] [Indexed(IndexEmptyAndMissing = false)] public required Guid Id { get; set; }
14+
[Indexed(IndexEmptyAndMissing = false)] public required Guid Owner { get; set; }
1515
[JsonConverter(typeof(SemVersionJsonConverter))]
1616
public required SemVersion FirmwareVersion { get; set; }
1717
public required string Gateway { get; set; }

Common/Redis/DevicePair.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ namespace OpenShock.Common.Redis;
55
[Document(StorageType = StorageType.Json, IndexName = "device-pair")]
66
public sealed class DevicePair
77
{
8-
[RedisIdField] [Indexed] public required Guid Id { get; set; }
9-
[Indexed] public required string PairCode { get; set; }
8+
[RedisIdField] [Indexed(IndexEmptyAndMissing = false)] public required Guid Id { get; set; }
9+
[Indexed(IndexEmptyAndMissing = false)] public required string PairCode { get; set; }
1010
}

Common/Redis/LcgNode.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ namespace OpenShock.Common.Redis;
55
[Document(StorageType = StorageType.Json, IndexName = "lcg-online-v4")]
66
public sealed class LcgNode
77
{
8-
[RedisIdField] [Indexed] public required string Fqdn { get; set; }
9-
[Indexed] public required string Country { get; set; }
10-
[Indexed(Sortable = true)] public required byte Load { get; set; }
11-
[Indexed] public string Environment { get; set; } = "Production";
8+
[RedisIdField] [Indexed(IndexEmptyAndMissing = false)] public required string Fqdn { get; set; }
9+
[Indexed(IndexEmptyAndMissing = false)] public required string Country { get; set; }
10+
[Indexed(Sortable = true, IndexEmptyAndMissing = false)] public required byte Load { get; set; }
11+
[Indexed(IndexEmptyAndMissing = false)] public string Environment { get; set; } = "Production";
1212

1313
}

Common/Redis/LoginSessions.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ namespace OpenShock.Common.Redis;
77
[Document(StorageType = StorageType.Json, IndexName = "login-session-v2")]
88
public sealed class LoginSession
99
{
10-
[RedisIdField] [Indexed] public required string Id { get; set; }
11-
[Indexed] public required Guid UserId { get; set; }
12-
[Indexed] public required string Ip { get; set; }
13-
[Indexed] public required string UserAgent { get; set; }
14-
[Indexed] public Guid? PublicId { get; set; }
10+
[RedisIdField] [Indexed(IndexEmptyAndMissing = false)] public required string Id { get; set; }
11+
[Indexed(IndexEmptyAndMissing = false)] public required Guid UserId { get; set; }
12+
[Indexed(IndexEmptyAndMissing = false)] public required string Ip { get; set; }
13+
[Indexed(IndexEmptyAndMissing = false)] public required string UserAgent { get; set; }
14+
[Indexed(IndexEmptyAndMissing = false)] public Guid? PublicId { get; set; }
1515
[JsonConverter(typeof(UnixMillisecondsDateTimeOffsetConverter))]
1616
public DateTimeOffset? Created { get; set; }
1717
[JsonConverter(typeof(UnixMillisecondsDateTimeOffsetConverter))]

0 commit comments

Comments
 (0)