Ghost/ghost/members-events-service
Thibaut Patel 161c0d7330 Added the members-events-service package
refs https://github.com/TryGhost/Team/issues/1306

- Contains all services that listen on member events
- Only contains the last-seen-at-updater service for now
- Listens for `MemberViewEvent` events to update the `member.last_seen_at` timestamp
- Updates after 24hours of the last timestamp to avoid too many writes
- Also updates when the value is NULL
- This is using the existing `last_seen_at` value to avoid an SQL query when no writes are required
2022-02-28 14:42:17 +01:00
..
lib Added the members-events-service package 2022-02-28 14:42:17 +01:00
test Added the members-events-service package 2022-02-28 14:42:17 +01:00
.eslintrc.js Added the members-events-service package 2022-02-28 14:42:17 +01:00
index.js Added the members-events-service package 2022-02-28 14:42:17 +01:00
LICENSE Added the members-events-service package 2022-02-28 14:42:17 +01:00
package.json Added the members-events-service package 2022-02-28 14:42:17 +01:00
README.md Added the members-events-service package 2022-02-28 14:42:17 +01:00

Members events service

Contains member services that listen on specific events to perform actions:

  • Last-seen-at updater: Updates members.last_seen_at on a page/post view event

Install

npm install @tryghost/members-events-service --save

or

yarn add @tryghost/members-events-service

Usage

Develop

This is a mono repository, managed with lerna.

Follow the instructions for the top-level repo.

  1. git clone this repo & cd into it as usual
  2. Run yarn to install top-level dependencies.

Run

  • yarn dev

Test

  • yarn lint run just eslint
  • yarn test run lint and tests

Copyright & License

Copyright (c) 2013-2022 Ghost Foundation - Released under the MIT license.