Skip to content

Commit

Permalink
feat: stop storing the message in the datastore
Browse files Browse the repository at this point in the history
  • Loading branch information
Steinertech9 committed Oct 29, 2024
1 parent 46725f1 commit c06d6df
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.9.2] - 2024-10-28

- feat: stop storing the message in the datastore

## [1.9.1] - 2024-09-04

- chore: apply linter suggestions
Expand Down
Binary file modified bun.lockb
Binary file not shown.
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ard-eventhub",
"version": "1.9.1",
"version": "1.9.2",
"description": "ARD system to distribute real-time (live) metadata for primarily radio broadcasts.",
"main": "./src/ingest/index.js",
"engines": {
Expand Down Expand Up @@ -28,25 +28,25 @@
"license": "EUPL-1.2",
"dependencies": {
"@google-cloud/datastore": "^9.1.0",
"@google-cloud/pubsub": "^4.7.0",
"@google-cloud/pubsub": "^4.8.0",
"@google-cloud/secret-manager": "^5.6.0",
"@swrlab/utils": "^2.0.1-beta",
"@swrlab/utils": "^2.0.2",
"compression": "^1.7.4",
"dd-trace": "^5.22.0",
"express": "^4.19.2",
"dd-trace": "^5.24.0",
"express": "^4.21.1",
"express-openapi-validator": "^5.3.4",
"firebase-admin": "^12.4.0",
"firebase-admin": "^12.7.0",
"google-auth-library": "^9.14.1",
"jsonwebtoken": "^9.0.2",
"luxon": "^3.5.0",
"slug": "^9.1.0",
"swagger-ui-express": "^5.0.1",
"ulid": "^2.3.0",
"winston": "^3.14.2"
"winston": "^3.15.0"
},
"devDependencies": {
"@biomejs/biome": "^1.8.3",
"@swrlab/style-guide": "^1.0.1",
"@swrlab/style-guide": "^1.0.2",
"chai": "^4.5.0",
"chai-http": "^4.4.0",
"docsify-cli": "^4.4.4",
Expand Down
7 changes: 3 additions & 4 deletions src/ingest/events/post.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

// load node utils
const { DateTime } = require('luxon')
const ULID = require('ulid')

// load eventhub utils
const datastore = require('../../utils/datastore')
const { createNewTopic, processServices } = require('../../utils/events')
const logger = require('../../utils/logger')
const pubsub = require('../../utils/pubsub')
Expand Down Expand Up @@ -84,9 +84,8 @@ module.exports = async (req, res) => {
message.services.map((service) => processServices(service, req))
)

// save message to datastore
const savedMessage = await datastore.save(message, 'events')
message.id = savedMessage.id.toString()
// generate unique Id from the institution id and a random ULID
message.id = `${req.user.institutionId}-${ULID.ulid()}`

// collect unknown topics from returning errors
const newServices = []
Expand Down

0 comments on commit c06d6df

Please sign in to comment.