Skip to content

Commit

Permalink
Update stats less frequently, and not at all in development
Browse files Browse the repository at this point in the history
  • Loading branch information
underbluewaters committed Apr 22, 2024
1 parent 107bed0 commit 475cecb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
15 changes: 11 additions & 4 deletions packages/api/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,15 +239,22 @@ run({
? parseInt(process.env.GRAPHILE_POLL_INTERVAL)
: 1000,
taskDirectory: path.join(__dirname, "..", "tasks"),
crontab: `
crontab:
process.env.NODE_ENV === "production"
? `
* * * * * cleanupProjectBackgroundJobs
* * * * * cleanupDeletedOverlayRecords
* * * * * collectActivityStats
* * * * * collectVisitorStats
* * * * * identifyVisitedProjects
*/2 * * * * collectVisitorStats
*/3 * * * * identifyVisitedProjects
*/2 * * * * collectMapDataRequestCounts
*/2 * * * * identifyProjectsWithDataRequests
*/3 * * * * identifyProjectsWithDataRequests
*/5 * * * * rollupDataSourceRequests
`
: `
* * * * * cleanupProjectBackgroundJobs
* * * * * cleanupDeletedOverlayRecords
* * * * * collectActivityStats
`,
}).then((runner) => {
runner.events.on("job:start", ({ worker, job }) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export default function Dashboard() {
{totalMapDataRequests?.toLocaleString()} Hosted Layer Requests
</span>
<span className="text-gray-500 italic hidden md:visible">
Updated every minute.
Updated every 5 minutes.
</span>
<span className="flex-1 text-right">
<select
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/admin/activity/ProjectDashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export default function ActivityDashboard() {
{totalMapDataRequests?.toLocaleString()} {t("Hosted Layer Requests")}
</span>
<span className="text-gray-500 italic hidden md:visible">
{t("Updated every minute.")}
{t("Updated every 5 minutes.")}
</span>
<span className="flex-1 text-right">
<select
Expand Down

0 comments on commit 475cecb

Please sign in to comment.