@@ -70,8 +70,7 @@ import {
70
70
} from "~/utils/pathBuilder" ;
71
71
import { SpanView } from "../resources.orgs.$organizationSlug.projects.v3.$projectParam.runs.$runParam.spans.$spanParam/route" ;
72
72
import { SimpleTooltip } from "~/components/primitives/Tooltip" ;
73
-
74
- const MAX_LIVE_RELOADING_EVENTS = 500 ;
73
+ import { env } from "~/env.server" ;
75
74
76
75
type TraceEvent = NonNullable < SerializeFrom < typeof loader > [ "trace" ] > [ "events" ] [ 0 ] ;
77
76
@@ -93,6 +92,7 @@ export const loader = async ({ request, params }: LoaderFunctionArgs) => {
93
92
return {
94
93
run : result . run ,
95
94
trace : result . trace ,
95
+ maximumLiveReloadingSetting : env . MAXIMUM_LIVE_RELOADING_EVENTS ,
96
96
resizeSettings,
97
97
} ;
98
98
} ;
@@ -103,7 +103,8 @@ function getSpanId(location: Location<any>): string | undefined {
103
103
}
104
104
105
105
export default function Page ( ) {
106
- const { run, trace, resizeSettings } = useLoaderData < typeof loader > ( ) ;
106
+ const { run, trace, resizeSettings, maximumLiveReloadingSetting } =
107
+ useLoaderData < typeof loader > ( ) ;
107
108
const organization = useOrganization ( ) ;
108
109
const project = useProject ( ) ;
109
110
const user = useUser ( ) ;
@@ -173,7 +174,7 @@ export default function Page() {
173
174
}
174
175
175
176
const { events, parentRunFriendlyId, duration, rootSpanStatus, rootStartedAt } = trace ;
176
- const shouldLiveReload = events . length <= MAX_LIVE_RELOADING_EVENTS ;
177
+ const shouldLiveReload = events . length <= maximumLiveReloadingSetting ;
177
178
178
179
const changeToSpan = useDebounce ( ( selectedSpan : string ) => {
179
180
replaceSearchParam ( "span" , selectedSpan ) ;
@@ -263,6 +264,7 @@ export default function Page() {
263
264
rootStartedAt = { rootStartedAt ? new Date ( rootStartedAt ) : undefined }
264
265
environmentType = { run . environment . type }
265
266
shouldLiveReload = { shouldLiveReload }
267
+ maximumLiveReloadingSetting = { maximumLiveReloadingSetting }
266
268
/>
267
269
</ ResizablePanel >
268
270
< ResizableHandle withHandle />
@@ -292,6 +294,7 @@ type TasksTreeViewProps = {
292
294
rootStartedAt : Date | undefined ;
293
295
environmentType : RuntimeEnvironmentType ;
294
296
shouldLiveReload : boolean ;
297
+ maximumLiveReloadingSetting : number ;
295
298
} ;
296
299
297
300
function TasksTreeView ( {
@@ -304,6 +307,7 @@ function TasksTreeView({
304
307
rootStartedAt,
305
308
environmentType,
306
309
shouldLiveReload,
310
+ maximumLiveReloadingSetting,
307
311
} : TasksTreeViewProps ) {
308
312
const [ filterText , setFilterText ] = useState ( "" ) ;
309
313
const [ errorsOnly , setErrorsOnly ] = useState ( false ) ;
@@ -381,6 +385,7 @@ function TasksTreeView({
381
385
< LiveReloadingStatus
382
386
rootSpanCompleted = { rootSpanStatus !== "executing" }
383
387
isLiveReloading = { shouldLiveReload }
388
+ settingValue = { maximumLiveReloadingSetting }
384
389
/>
385
390
</ div >
386
391
< TreeView
@@ -851,9 +856,11 @@ function ShowParentLink({ runFriendlyId }: { runFriendlyId: string }) {
851
856
function LiveReloadingStatus ( {
852
857
rootSpanCompleted,
853
858
isLiveReloading,
859
+ settingValue,
854
860
} : {
855
861
rootSpanCompleted : boolean ;
856
862
isLiveReloading : boolean ;
863
+ settingValue : number ;
857
864
} ) {
858
865
if ( rootSpanCompleted ) return null ;
859
866
@@ -868,7 +875,7 @@ function LiveReloadingStatus({
868
875
</ div >
869
876
) : (
870
877
< SimpleTooltip
871
- content = { `Live reloading is disabled because you've exceeded ${ MAX_LIVE_RELOADING_EVENTS } logs.` }
878
+ content = { `Live reloading is disabled because you've exceeded ${ settingValue } logs.` }
872
879
button = {
873
880
< div className = "flex items-center gap-1" >
874
881
< BoltSlashIcon className = "size-3.5 text-text-dimmed" />
0 commit comments