Skip to content

Commit

Permalink
Merge branch 'production' into fix/160-invalid-date-format-on-import-csv
Browse files Browse the repository at this point in the history
  • Loading branch information
Joao-vi authored Dec 16, 2024
2 parents e71a2a1 + efc5f1c commit d567e84
Show file tree
Hide file tree
Showing 9 changed files with 144 additions and 4,488 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ci_cypress_component.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ jobs:
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: install dependencies
run: yarn install
- name: generate global css
run: yarn tailwind
- name: Cypress run
uses: cypress-io/github-action@v5
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,4 @@ cypress/videos/*
*.diff.png
*.actual.png
.trunk/*
app/react/App/styles/globals.css
4 changes: 2 additions & 2 deletions app/api/queue.v2/configuration/factories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ import {
getSharedClient,
getSharedConnection,
} from 'api/common.v2/database/getConnectionForCurrentTenant';
import { DefaultLogger } from 'api/log.v2/infrastructure/StandardLogger';
import { DefaultLogger, SystemLogger } from 'api/log.v2/infrastructure/StandardLogger';
import { JobsRouter } from '../infrastructure/JobsRouter';
import { MongoQueueAdapter } from '../infrastructure/MongoQueueAdapter';
import { NamespacedDispatcher } from '../infrastructure/NamespacedDispatcher';

export function DefaultQueueAdapter() {
return new MongoQueueAdapter(
getSharedConnection(),
new MongoTransactionManager(getSharedClient(), DefaultLogger())
new MongoTransactionManager(getSharedClient(), SystemLogger())
);
}

Expand Down
20 changes: 19 additions & 1 deletion app/queueRegistry.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Dispatchable } from 'api/queue.v2/application/contracts/Dispatchable';
import { Dispatchable, HeartbeatCallback } from 'api/queue.v2/application/contracts/Dispatchable';
import { DispatchableClass } from 'api/queue.v2/application/contracts/JobsDispatcher';
import {
UpdateTemplateRelationshipPropertiesJob as createUpdateTemplateRelationshipPropertiesJob,
Expand All @@ -7,6 +7,23 @@ import {
import { UpdateRelationshipPropertiesJob } from 'api/relationships.v2/services/propertyUpdateStrategies/UpdateRelationshipPropertiesJob';
import { UpdateTemplateRelationshipPropertiesJob } from 'api/relationships.v2/services/propertyUpdateStrategies/UpdateTemplateRelationshipPropertiesJob';

function randomIntFromInterval(min, max) {
// min and max included
return Math.floor(Math.random() * (max - min + 1) + min);
}

export class TestJob implements Dispatchable {
static BATCH_SIZE = 200;

constructor() {}

Check failure on line 18 in app/queueRegistry.ts

View workflow job for this annotation

GitHub Actions / eslint

Useless constructor

Check failure on line 18 in app/queueRegistry.ts

View workflow job for this annotation

GitHub Actions / eslint

Unexpected empty constructor

async handleDispatch(_heartbeat: HeartbeatCallback) {
await new Promise(resolve => {
setTimeout(resolve, randomIntFromInterval(1000, 2000));
});
}
}

export function registerJobs(
register: <T extends Dispatchable>(
dispatchable: DispatchableClass<T>,
Expand All @@ -15,4 +32,5 @@ export function registerJobs(
) {
register(UpdateRelationshipPropertiesJob, async () => createUpdateRelationshipPropertiesJob());
register(UpdateTemplateRelationshipPropertiesJob, createUpdateTemplateRelationshipPropertiesJob);
register(TestJob, async () => new TestJob());
}
Loading

0 comments on commit d567e84

Please sign in to comment.