Skip to content

Commit

Permalink
disable resync button for CH or PG destinations (#1333)
Browse files Browse the repository at this point in the history
also minor bug fix with addpub, multiple state updates wouldn't have
worked
  • Loading branch information
heavycrystal authored Feb 21, 2024
1 parent 37d88f3 commit 2c170e6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
4 changes: 2 additions & 2 deletions flow/workflows/cdc_flow.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,9 @@ func (w *CDCFlowWorkflowExecution) processCDCFlowConfigUpdates(ctx workflow.Cont
}
state.TableMappings = append(state.TableMappings, flowConfigUpdate.AdditionalTables...)
state.SyncFlowOptions.TableMappings = state.TableMappings
// finished processing, wipe it
state.FlowConfigUpdates = nil
}
// finished processing, wipe it
state.FlowConfigUpdates = nil
return nil
}

Expand Down
20 changes: 14 additions & 6 deletions ui/app/mirrors/[mirrorId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import prisma from '@/app/utils/prisma';
import EditButton from '@/components/EditButton';
import { ResyncDialog } from '@/components/ResyncDialog';
import { FlowConnectionConfigs } from '@/grpc_generated/flow';
import { DBType } from '@/grpc_generated/peers';
import { MirrorStatusResponse } from '@/grpc_generated/route';
import { Header } from '@/lib/Header';
import { LayoutMain } from '@/lib/Layout';
Expand Down Expand Up @@ -87,12 +88,19 @@ export default async function ViewMirror({
return acc;
}, 0);
const mirrorConfig = FlowConnectionConfigs.decode(mirrorInfo.config_proto!);
resyncComponent = (
<ResyncDialog
mirrorConfig={mirrorConfig}
workflowId={mirrorInfo.workflow_id || ''}
/>
);
const dbType = mirrorConfig.destination!.type;
const canResync =
dbType.valueOf() === DBType.BIGQUERY.valueOf() ||
dbType.valueOf() === DBType.SNOWFLAKE.valueOf();
if (canResync) {
resyncComponent = (
<ResyncDialog
mirrorConfig={mirrorConfig}
workflowId={mirrorInfo.workflow_id || ''}
/>
);
}

syncStatusChild = (
<SyncStatus rowsSynced={rowsSynced} rows={rows} flowJobName={mirrorId} />
);
Expand Down

0 comments on commit 2c170e6

Please sign in to comment.