Skip to content

Commit

Permalink
fix: 等待时间下限不一致
Browse files Browse the repository at this point in the history
  • Loading branch information
Zaitonn committed Jan 6, 2025
1 parent e7b4f14 commit 54a1de4
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build

WORKDIR /src
COPY . .

ARG TARGETARCH
Expand All @@ -9,7 +8,7 @@ RUN dotnet publish src/Serein.Cli -a $TARGETARCH -c Release -o /app/bin
WORKDIR /app/bin
ENV DOTNET_EnableWriteXorExecute=0

RUN echo "#!/bin/sh \r\n/app/bin/Serein.Cli" > /app/bin/serein-entrypoint.sh
COPY ./src/Scripts/serein-entrypoint.sh /app/bin/serein-entrypoint.sh
RUN chmod +x /app/bin/serein-entrypoint.sh

ENTRYPOINT [ "/app/bin/serein-entrypoint.sh" ]
3 changes: 3 additions & 0 deletions src/Scripts/serein-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

./Serein.Cli
4 changes: 3 additions & 1 deletion src/Serein.Core/Services/Plugins/EventDispatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ internal bool Dispatch(Event @event, params object[] args)
}

cancellationTokenSource.Cancel();
return !tasks.Where((task) => task.IsCompleted).Any((task) => !task.Result);

var completedTasks = tasks.Where(task => task.IsCompleted);
return !completedTasks.Any() || completedTasks.All(task => task.Result);
}

private void DispatchToJsPlugins(
Expand Down
4 changes: 2 additions & 2 deletions src/Serein.Plus/Pages/Settings/AppSettingPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
HorizontalAlignment="Left"
ui:ControlHelper.Header="事件最大等待时间 (ms)"
LostFocus="OnPropertyChanged"
Minimum="-1"
Minimum="0"
SpinButtonPlacementMode="Compact"
ToolTip="超出此时间返回的结果将被忽略;设置成-1可禁用等待"
ToolTip="超出此时间返回的结果将被忽略;设置成0可禁用等待"
Value="{Binding Value.Application.PluginEventMaxWaitingTime}" />
<TextBox
ui:ControlHelper.Header="JS插件全局加载的程序集"
Expand Down

0 comments on commit 54a1de4

Please sign in to comment.