Skip to content

Commit

Permalink
remove some moment stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
sanoel committed Sep 20, 2024
1 parent ec649d9 commit e3e59ad
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export class Runner {
contentType: tree.bookmarks.services['*'].jobs.pending['*']._type,
data: {
status,
time: moment().toISOString(),
time: new Date().toISOString(),
meta,
},
});
Expand Down
5 changes: 2 additions & 3 deletions src/Service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import { debug, error, warn } from './utils.js';
import type { Job } from './Job.js';
import type { Json } from './index.js';
import type { Logger } from './Logger.js';
import moment from 'moment';
import { Queue } from './Queue.js';

export type Domain = string;
Expand Down Expand Up @@ -312,7 +311,7 @@ export class Service {
}

async #initTotalMetrics(): Promise<void> {
const date = moment().format('YYYY-MM-DD');
const date = new Date().toISOString().split('T')[0];
for await (const status of ['success', 'failure']) {
try {
let { data } = await this.#oada.get({
Expand All @@ -328,7 +327,7 @@ export class Service {

async #initTypedMetrics(type: string): Promise<void> {
let mtype = type.replaceAll('-', '_').replaceAll(' ', '_');
const date = moment().format('YYYY-MM-DD');
const date = new Date().toISOString().split('T')[0];
for await (const status of ['success', 'failure']) {
try {
this.metrics[`${this.name}_${status}_${mtype}`].set(0);
Expand Down
3 changes: 1 addition & 2 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
*/

import _debug from 'debug';
import moment from 'moment';

import type { ConnectionResponse, Json, OADAClient } from '@oada/client';

Expand Down Expand Up @@ -101,7 +100,7 @@ export async function postUpdate(
contentType: tree.bookmarks.services['*'].jobs.pending['*']._type,
data: {
status,
time: moment().toISOString(),
time: new Date().toISOString(),
meta,
},
});
Expand Down

0 comments on commit e3e59ad

Please sign in to comment.