Skip to content

Commit

Permalink
cleanup: remove impressions worker (#3989)
Browse files Browse the repository at this point in the history
  • Loading branch information
bigint committed Nov 13, 2023
2 parents 5b2d20e + 12a5a1f commit db7f499
Show file tree
Hide file tree
Showing 19 changed files with 14 additions and 156 deletions.
2 changes: 1 addition & 1 deletion apps/web/src/lib/leafwatch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const Leafwatch = {
worker.onmessage = function (event: MessageEvent) {
const response = event.data;
const xhr = new XMLHttpRequest();
xhr.open('POST', `${LEAFWATCH_WORKER_URL}/ingest`);
xhr.open('POST', `${LEAFWATCH_WORKER_URL}/events`);
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.send(JSON.stringify(response));
};
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/service-workers/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
declare let self: ServiceWorkerGlobalScope;

const impressionsEndpoint = 'https://impressions.hey.xyz/ingest';
const impressionsEndpoint = 'https://leafwatch.hey.xyz/impressions';
const publicationsVisibilityInterval = 5000;
let viewerId: string | null = null;
let visiblePublicationsSet = new Set();
Expand Down
7 changes: 3 additions & 4 deletions docs/ports.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ The following ports are exposed by the repository
| 8092 | NFT worker | http://localhost:8092 | https://nft.hey.xyz |
| 8093 | Staff Picks worker | http://localhost:8093 | https://staff-picks.hey.xyz |
| 8094 | Live worker | http://localhost:8094 | https://live.hey.xyz |
| 8095 | Impressions worker | http://localhost:8095 | https://impressions.hey.xyz |
| 8096 | Sitemap worker | http://localhost:8096 | https://sitemap.hey.xyz |
| 8097 | Features worker | http://localhost:8097 | https://features.hey.xyz |
| 8098 | Pro worker | http://localhost:8098 | https://pro.hey.xyz |
| 8095 | Sitemap worker | http://localhost:8095 | https://sitemap.hey.xyz |
| 8096 | Features worker | http://localhost:8096 | https://features.hey.xyz |
| 8097 | Pro worker | http://localhost:8097 | https://pro.hey.xyz |
4 changes: 2 additions & 2 deletions packages/data/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ export const LIVE_WORKER_URL = IS_PRODUCTION
: 'http://localhost:8094';
export const FEATURES_WORKER_URL = IS_PRODUCTION
? 'https://features.hey.xyz'
: 'http://localhost:8097';
: 'http://localhost:8096';
export const PRO_WORKER_URL = IS_PRODUCTION
? 'https://pro.hey.xyz'
: 'http://localhost:8098';
: 'http://localhost:8097';

// Tokens / Keys
export const OPENSEA_KEY = '8b95f9e6d52b42fe8c19ddea847c0f5d';
Expand Down
2 changes: 1 addition & 1 deletion packages/workers/features/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"license": "AGPL-3.0",
"scripts": {
"dev": "wrangler dev --port 8097",
"dev": "wrangler dev --port 8096",
"lint": "eslint . --ext .ts",
"lint:fix": "eslint . --fix --ext .ts",
"prettier": "prettier --check \"**/*.{js,ts,tsx,md}\" --cache",
Expand Down
1 change: 0 additions & 1 deletion packages/workers/impressions/.dev.vars.example

This file was deleted.

6 changes: 0 additions & 6 deletions packages/workers/impressions/.eslintrc.js

This file was deleted.

15 changes: 0 additions & 15 deletions packages/workers/impressions/README.md

This file was deleted.

31 changes: 0 additions & 31 deletions packages/workers/impressions/package.json

This file was deleted.

16 changes: 0 additions & 16 deletions packages/workers/impressions/src/helpers/buildRequest.ts

This file was deleted.

43 changes: 0 additions & 43 deletions packages/workers/impressions/src/index.ts

This file was deleted.

12 changes: 0 additions & 12 deletions packages/workers/impressions/src/types.ts

This file was deleted.

6 changes: 0 additions & 6 deletions packages/workers/impressions/tsconfig.json

This file was deleted.

13 changes: 0 additions & 13 deletions packages/workers/impressions/wrangler.toml

This file was deleted.

6 changes: 4 additions & 2 deletions packages/workers/leafwatch/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { Errors } from '@hey/data/errors';
import response from '@hey/lib/response';
import { createCors, error, Router, status } from 'itty-router';

import ingest from './handlers/ingest';
import events from './handlers/events';
import impressions from './handlers/impressions';
import buildRequest from './helpers/buildRequest';
import type { Env, WorkerRequest } from './types';

Expand All @@ -22,7 +23,8 @@ router
version: request.env.RELEASE ?? 'unknown'
})
)
.post('/ingest', ingest)
.post('/events', events)
.post('/impressions', impressions)
.all('*', () => error(404));

export default {
Expand Down
2 changes: 1 addition & 1 deletion packages/workers/pro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"license": "AGPL-3.0",
"scripts": {
"dev": "wrangler dev --port 8098",
"dev": "wrangler dev --port 8097",
"lint": "eslint . --ext .ts",
"lint:fix": "eslint . --fix --ext .ts",
"prettier": "prettier --check \"**/*.{js,ts,tsx,md}\" --cache",
Expand Down
2 changes: 1 addition & 1 deletion packages/workers/sitemap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"license": "AGPL-3.0",
"scripts": {
"dev": "wrangler dev --port 8096",
"dev": "wrangler dev --port 8095",
"lint": "eslint . --ext .ts",
"lint:fix": "eslint . --fix --ext .ts",
"prettier": "prettier --check \"**/*.{js,ts,tsx,md}\" --cache",
Expand Down

2 comments on commit db7f499

@vercel
Copy link

@vercel vercel bot commented on db7f499 Nov 13, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

prerender – ./apps/prerender

prerender-heyxyz.vercel.app
prerender.hey.xyz
prerender-git-main-heyxyz.vercel.app

@vercel
Copy link

@vercel vercel bot commented on db7f499 Nov 13, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

web – ./apps/web

hey.xyz
heyxyz.vercel.app
web-heyxyz.vercel.app
web-git-main-heyxyz.vercel.app

Please sign in to comment.