@@ -66,17 +66,14 @@ public void onChannelUpdateAppliedTags(@NotNull ChannelUpdateAppliedTagsEvent ev
66
66
private void handleThreadStatus (ThreadChannel threadChannel ) {
67
67
Instant closedAt = threadChannel .getTimeArchiveInfoLastModified ().toInstant ();
68
68
long threadId = threadChannel .getIdLong ();
69
+ boolean isArchived = threadChannel .isArchived ();
69
70
70
- int status = database .read (context -> context .selectFrom (HELP_THREADS )
71
- .where (HELP_THREADS .CHANNEL_ID .eq (threadId ))
72
- .fetchOne (HELP_THREADS .TICKET_STATUS ));
73
-
74
- if (status == HelpSystemHelper .TicketStatus .ACTIVE .val ) {
71
+ if (isArchived ) {
75
72
handleArchiveStatus (closedAt , threadChannel );
76
73
return ;
77
74
}
78
75
79
- changeStatusToActive (threadId );
76
+ updateThreadStatusToActive (threadId );
80
77
}
81
78
82
79
void handleArchiveStatus (Instant closedAt , ThreadChannel threadChannel ) {
@@ -95,7 +92,7 @@ void handleArchiveStatus(Instant closedAt, ThreadChannel threadChannel) {
95
92
logger .info ("Thread with id: {}, updated to archived status in database" , threadId );
96
93
}
97
94
98
- private void changeStatusToActive (long threadId ) {
95
+ private void updateThreadStatusToActive (long threadId ) {
99
96
database .write (context -> context .update (HELP_THREADS )
100
97
.set (HELP_THREADS .TICKET_STATUS , HelpSystemHelper .TicketStatus .ACTIVE .val )
101
98
.where (HELP_THREADS .CHANNEL_ID .eq (threadId ))
0 commit comments