Skip to content

OpenPanel is an open-source web and product analytics platform, an open-source alternative to Mixpanel with optional self-hosting.

fix ping

Carl-Gerhard Lindesvärd9fab18a8951a
diff --git a/apps/api/src/controllers/misc.controller.ts b/apps/api/src/controllers/misc.controller.ts
index 3a094fb0f..a37f9cc94 100644
--- a/apps/api/src/controllers/misc.controller.ts
+++ b/apps/api/src/controllers/misc.controller.ts
@@ -5,7 +5,7 @@ import icoToPng from 'ico-to-png';
import sharp from 'sharp';
import { createHash } from '@openpanel/common';
-import { ch, TABLE_NAMES } from '@openpanel/db';
+import { ch, formatClickhouseDate, TABLE_NAMES } from '@openpanel/db';
import { getRedisCache } from '@openpanel/redis';
interface GetFaviconParams {
@@ -128,7 +128,7 @@ export async function ping(
{
domain: request.body.domain,
count: request.body.count,
- created_at: new Date(),
+ created_at: formatClickhouseDate(new Date(), true),
},
],
format: 'JSONEachRow',
diff --git a/apps/worker/src/jobs/cron.ping.ts b/apps/worker/src/jobs/cron.ping.ts
index 9c55dbf63..051f77ad6 100644
--- a/apps/worker/src/jobs/cron.ping.ts
+++ b/apps/worker/src/jobs/cron.ping.ts
@@ -6,7 +6,7 @@ export async function ping() {
);
if (typeof res?.count === 'number') {
- const response = await fetch('https://api.openpanel.com/misc/ping', {
+ const response = await fetch('https://api.openpanel.dev/misc/ping', {
method: 'POST',
headers: {
'Content-Type': 'application/json',