Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
safeer authored and wesbillman committed Nov 6, 2024
1 parent ed7ec3b commit 0b4f3c7
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 23 deletions.
10 changes: 4 additions & 6 deletions backend/controller/pubsub/internal/dal/dal.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,17 +150,15 @@ func (d *DAL) ProgressSubscriptions(ctx context.Context, eventConsumptionDelay t
return 0, err
}
if !nextCursor.Ready {
s := fmt.Sprintf("Skipping subscription %s because event is too new", subscription.Key)
logger.Tracef(s)
enqueueTimelineEvent(optional.None[schema.RefKey](), optional.Some(s))
logger.Tracef("Skipping subscription %s because event is too new", subscription.Key)
enqueueTimelineEvent(optional.None[schema.RefKey](), optional.Some(fmt.Sprintf("Skipping subscription %s because event is too new", subscription.Key)))
continue
}

subscriber, err := tx.db.GetRandomSubscriber(ctx, subscription.Key)
if err != nil {
s := fmt.Sprintf("no subscriber for subscription %s", subscription.Key)
logger.Tracef(s)
enqueueTimelineEvent(optional.None[schema.RefKey](), optional.Some(s))
logger.Tracef("no subscriber for subscription %s", subscription.Key)
enqueueTimelineEvent(optional.None[schema.RefKey](), optional.Some(fmt.Sprintf("no subscriber for subscription %s", subscription.Key)))
continue
}

Expand Down
2 changes: 1 addition & 1 deletion backend/controller/timeline/events_pubsub_consume.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ type PubSubConsume struct {
Error optional.Option[string]
}

func (e *PubSubConsume) toEvent() (Event, error) {
func (e *PubSubConsume) toEvent() (Event, error) { //nolint:unparam
return &PubSubConsumeEvent{
PubSubConsume: *e,
Duration: time.Since(e.Time),
Expand Down
2 changes: 1 addition & 1 deletion backend/controller/timeline/events_pubsub_publish.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type PubSubPublish struct {
Error optional.Option[string]
}

func (e *PubSubPublish) toEvent() (Event, error) {
func (e *PubSubPublish) toEvent() (Event, error) { //nolint:unparam
return &PubSubPublishEvent{
PubSubPublish: *e,
Duration: time.Since(e.Time),
Expand Down
4 changes: 2 additions & 2 deletions frontend/console/src/features/timeline/Timeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import { TimelineDeploymentUpdatedDetails } from './details/TimelineDeploymentUp
import { TimelineDetailsHeader } from './details/TimelineDetailsHeader.tsx'
import { TimelineIngressDetails } from './details/TimelineIngressDetails.tsx'
import { TimelineLogDetails } from './details/TimelineLogDetails.tsx'
import type { TimeSettings } from './filters/TimelineTimeControls.tsx'
import { TimelinePubSubPublishDetails } from './details/TimelinePubSubPublishDetails.tsx'
import { TimelinePubSubConsumeDetails } from './details/TimelinePubSubConsumeDetails.tsx'
import { TimelinePubSubPublishDetails } from './details/TimelinePubSubPublishDetails.tsx'
import type { TimeSettings } from './filters/TimelineTimeControls.tsx'

export const Timeline = ({ timeSettings, filters }: { timeSettings: TimeSettings; filters: EventsQuery_Filter[] }) => {
const [searchParams, setSearchParams] = useSearchParams()
Expand Down
2 changes: 1 addition & 1 deletion frontend/console/src/features/timeline/TimelineIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import {
Menu01Icon,
PackageReceiveIcon,
Rocket01Icon,
SatelliteIcon,
Satellite03Icon,
SatelliteIcon,
TimeQuarterPassIcon,
} from 'hugeicons-react'
import type { Event } from '../../protos/xyz/block/ftl/v1/console/console_pb'
Expand Down
10 changes: 5 additions & 5 deletions frontend/console/src/features/timeline/TimelinePubSubConsume.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { PubSubConsumeEvent } from '../../protos/xyz/block/ftl/v1/console/console_pb'
import type { PubSubConsumeEvent } from '../../protos/xyz/block/ftl/v1/console/console_pb'

export const TimelinePubSubConsume = ({ pubSubConsume }: { pubSubConsume: PubSubConsumeEvent }) => {
var title = `Topic ${pubSubConsume.topic} propagated by controller`
var consumedBy = undefined
let title = `Topic ${pubSubConsume.topic} propagated by controller`
let consumedBy = undefined
if (pubSubConsume.destVerbName) {
consumedBy = `${(pubSubConsume.destVerbModule && pubSubConsume.destVerbModule + '.') || ''}.${pubSubConsume.destVerbName}`
consumedBy = `${(pubSubConsume.destVerbModule && `${pubSubConsume.destVerbModule}.`) || ''}.${pubSubConsume.destVerbName}`
title = `Topic ${pubSubConsume.topic} consumed by ${consumedBy}`
}

Expand All @@ -16,7 +16,7 @@ export const TimelinePubSubConsume = ({ pubSubConsume }: { pubSubConsume: PubSub
<>
{' consumed by '}
<span className='text-indigo-500 dark:text-indigo-300'>
{(pubSubConsume.destVerbModule && pubSubConsume.destVerbModule + '.') || ''}
{(pubSubConsume.destVerbModule && `${pubSubConsume.destVerbModule}.`) || ''}
{pubSubConsume.destVerbName || 'unknown'}
</span>
</>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { AttributeBadge } from '../../../components/AttributeBadge'
import type { Event, PubSubConsumeEvent } from '../../../protos/xyz/block/ftl/v1/console/console_pb'
import { formatDuration } from '../../../utils/date.utils'
import { DeploymentCard } from '../../../features/deployments/DeploymentCard'
import { TraceGraph } from '../../../features/traces/TraceGraph'
import { TraceGraphHeader } from '../../../features/traces/TraceGraphHeader'
import type { Event, PubSubConsumeEvent } from '../../../protos/xyz/block/ftl/v1/console/console_pb'
import { formatDuration } from '../../../utils/date.utils'

export const TimelinePubSubConsumeDetails = ({ event }: { event: Event }) => {
const pubSubConsume = event.entry.value as PubSubConsumeEvent
const destModule = `${(pubSubConsume.destVerbModule && pubSubConsume.destVerbModule + '.') || ''}${pubSubConsume.destVerbName || 'unknown'}`
const destModule = `${(pubSubConsume.destVerbModule && `${pubSubConsume.destVerbModule}.`) || ''}${pubSubConsume.destVerbName || 'unknown'}`

return (
<>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { AttributeBadge } from '../../../components/AttributeBadge'
import type { Event, PubSubPublishEvent } from '../../../protos/xyz/block/ftl/v1/console/console_pb'
import { refString } from '../../../features/verbs/verb.utils'
import { formatDuration } from '../../../utils/date.utils'
import { DeploymentCard } from '../../../features/deployments/DeploymentCard'
import { TraceGraph } from '../../../features/traces/TraceGraph'
import { TraceGraphHeader } from '../../../features/traces/TraceGraphHeader'
import { refString } from '../../../features/verbs/verb.utils'
import type { Event, PubSubPublishEvent } from '../../../protos/xyz/block/ftl/v1/console/console_pb'
import { formatDuration } from '../../../utils/date.utils'

export const TimelinePubSubPublishDetails = ({ event }: { event: Event }) => {
const pubSubPublish = event.entry.value as PubSubPublishEvent
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Call02Icon, CustomerServiceIcon, PackageReceiveIcon, Rocket01Icon, SatelliteIcon, Satellite03Icon, TimeQuarterPassIcon } from 'hugeicons-react'
import { Call02Icon, CustomerServiceIcon, PackageReceiveIcon, Rocket01Icon, Satellite03Icon, SatelliteIcon, TimeQuarterPassIcon } from 'hugeicons-react'
import type React from 'react'
import { useEffect, useState } from 'react'
import { useModules } from '../../../api/modules/use-modules'
Expand Down

0 comments on commit 0b4f3c7

Please sign in to comment.