Skip to content

Commit

Permalink
Logging cleanup from async reconcile (#3253)
Browse files Browse the repository at this point in the history
  • Loading branch information
AdityaHegde authored Oct 17, 2023
1 parent b9c7349 commit 04ccd4d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ export function invalidateResourceResponse(
) {
// only process for the `ResourceKind` present in `UsedResourceKinds`
if (!UsedResourceKinds[res.name.kind]) return;
console.log(
`[${res.resource.meta.reconcileStatus}] ${res.name.kind}/${res.name.name}`
);

const instanceId = get(runtime).instanceId;
if (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ function handleWatchFileResponse(
res: V1WatchFilesResponse
) {
if (res.path.includes(".db")) return;
console.log(`[${res.event}] ${res.path}`);
// Watch file returns events for all files under the project. Ignore everything except .sql, .yaml & .yml
if (
!res.path.endsWith(".sql") &&
Expand Down
16 changes: 10 additions & 6 deletions web-common/src/features/models/workspace/ModelBody.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,6 @@
const limit = 150;
$: tableQuery = createQueryServiceTableRows(runtimeInstanceId, modelName, {
limit,
});
$: runtimeError = ($tableQuery.error as any)?.response.data;
// track innerHeight to calculate the size of the editor element.
let innerHeight: number;
Expand All @@ -73,6 +67,16 @@
);
$: modelError = $allErrors?.[0]?.message;
$: tableQuery = createQueryServiceTableRows(
runtimeInstanceId,
$modelQuery.data?.model?.state?.table,
{
limit,
}
);
$: runtimeError = ($tableQuery.error as any)?.response.data;
const outputLayout = getContext(
"rill:app:output-layout"
) as Writable<LayoutElement>;
Expand Down
11 changes: 5 additions & 6 deletions web-common/src/runtime-client/watch-request-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,7 @@ export class WatchRequestClient<Res extends WatchResponse> {
}
return;
}
if (!this.prevFocus) {
console.log("Focus reconnect");
// Call onReconnect on page focus to make sure we didnt miss anything
this.onReconnect();
}
const prevFocus = this.prevFocus;
this.prevInstanceId = runtimeState.instanceId;
this.prevHost = runtimeState.host;
this.prevFocus = true;
Expand All @@ -69,6 +65,10 @@ export class WatchRequestClient<Res extends WatchResponse> {
// The client is already running. Do not cancel the client.
return;
}
// Call onReconnect on page focus to make sure we didnt miss anything
if (!prevFocus) {
this.onReconnect();
}
this.controller?.abort();
if (!runtimeState?.instanceId) return;

Expand Down Expand Up @@ -107,7 +107,6 @@ export class WatchRequestClient<Res extends WatchResponse> {
else if (res.result) this.onResponse(res.result);
}
} catch (err) {
console.log(err);
if (!(await this.tracker.failed())) {
return;
}
Expand Down

1 comment on commit 04ccd4d

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.