Compare commits

...

5 Commits

Author SHA1 Message Date
yumeko 5f2c7a1cf9 Merge branch 'fix/server-stats-disable' into 'develop'
Fix check for whether stats are disabled in meta in server machine stats job


See merge request firefish/firefish!10748
2024-04-17 18:19:27 +00:00
naskya c471aa30ae Merge branch 'fix/pinned-user-null' into 'develop'
Fix internal error in api/pinned-users if one or more name fails to resolve

Co-authored-by: yumeko <yumeko@mainichi.social>

See merge request firefish/firefish!10747
2024-04-17 18:19:17 +00:00
yumeko a411f4e4d9 Fix internal error in api/pinned-users if one or more name fails to resolve 2024-04-17 18:19:17 +00:00
naskya 22f4278ab5
meta: update issue/merge request templates 2024-04-17 23:14:43 +09:00
yumeko bf3c0717b9 Fix check for whether stats are disabled in meta in server machine stats job 2024-04-16 15:29:18 +00:00
5 changed files with 21 additions and 8 deletions

View File

@ -5,30 +5,39 @@
## What happened? <!-- Please give us a brief description of what happened. --> ## What happened? <!-- Please give us a brief description of what happened. -->
## What did you expect to happen? <!-- Please give us a brief description of what you expected to happen. --> ## What did you expect to happen? <!-- Please give us a brief description of what you expected to happen. -->
## Version <!-- What version of firefish is your instance running? You can find this by clicking your instance's logo at the bottom left and then clicking instance information. --> ## Version <!-- What version of firefish is your instance running? You can find this by clicking your instance's logo at the bottom left and then clicking instance information. -->
## What type of issue is this? <!-- If this happens on your device and has to do with the user interface, it's client-side. If this happens on either with the API or the backend, or you got a server-side error in the client, it's server-side. --> ## What type of issue is this? <!-- If this happens on your device and has to do with the user interface, it's client-side. If this happens on either with the API or the backend, or you got a server-side error in the client, it's server-side. -->
- [] server-side - [ ] server-side
- [] client-side - [ ] client-side
- [] not sure - [ ] not sure
<details> <details>
### Instance <!-- What instance of firefish are you using? --> ### Instance <!-- What instance of firefish are you using? -->
### What browser are you using? (client-side issues only) ### What browser are you using? (client-side issues only)
### What operating system are you using? (client-side issues only) ### What operating system are you using? (client-side issues only)
### How do you deploy Firefish on your server? (server-side issues only) ### How do you deploy Firefish on your server? (server-side issues only)
### What operating system are you using? (Server-side issues only) ### What operating system are you using? (Server-side issues only)
### Relevant log output <!-- Please copy and paste any relevant log output. You can find your log by inspecting the page, and going to the "console" tab. --> ### Relevant log output <!-- Please copy and paste any relevant log output. You can find your log by inspecting the page, and going to the "console" tab. -->
</details> </details>
## Contribution Guidelines ## Contribution Guidelines

View File

@ -5,12 +5,16 @@
## What feature would you like implemented? <!-- Please give us a brief description of what you'd like. --> ## What feature would you like implemented? <!-- Please give us a brief description of what you'd like. -->
## Why should we add this feature? <!-- Please give us a brief description of why your feature is important. --> ## Why should we add this feature? <!-- Please give us a brief description of why your feature is important. -->
## Version <!-- What version of firefish is your instance running? You can find this by clicking your instance's logo at the bottom left and then clicking instance information. --> ## Version <!-- What version of firefish is your instance running? You can find this by clicking your instance's logo at the bottom left and then clicking instance information. -->
## Instance <!-- What instance of firefish are you using? --> ## Instance <!-- What instance of firefish are you using? -->
## Contribution Guidelines ## Contribution Guidelines
By submitting this issue, you agree to follow our [Contribution Guidelines](https://firefish.dev/firefish/firefish/-/blob/develop/CONTRIBUTING.md) By submitting this issue, you agree to follow our [Contribution Guidelines](https://firefish.dev/firefish/firefish/-/blob/develop/CONTRIBUTING.md)
- [ ] I agree to follow this project's Contribution Guidelines - [ ] I agree to follow this project's Contribution Guidelines

View File

@ -2,6 +2,7 @@
## What does this PR do? <!-- Please give us a brief description of what this PR does. --> ## What does this PR do? <!-- Please give us a brief description of what this PR does. -->
## Contribution Guidelines ## Contribution Guidelines
By submitting this merge request, you agree to follow our [Contribution Guidelines](https://firefish.dev/firefish/firefish/-/blob/develop/CONTRIBUTING.md) By submitting this merge request, you agree to follow our [Contribution Guidelines](https://firefish.dev/firefish/firefish/-/blob/develop/CONTRIBUTING.md)
- [ ] This change is reviewed in an issue / This is a minor bug fix - [ ] This change is reviewed in an issue / This is a minor bug fix

View File

@ -13,16 +13,15 @@ const round = (num: number) => Math.round(num * 10) / 10;
/** /**
* Report server stats regularly * Report server stats regularly
*/ */
export default function () { export default async function () {
const log = [] as any[]; const log = [] as any[];
ev.on("requestServerStatsLog", (x) => { ev.on("requestServerStatsLog", (x) => {
ev.emit(`serverStatsLog:${x.id}`, log.slice(0, x.length || 50)); ev.emit(`serverStatsLog:${x.id}`, log.slice(0, x.length || 50));
}); });
fetchMeta(true).then((meta) => { const meta = await fetchMeta(true);
if (!meta.enableServerMachineStats) return; if (!meta.enableServerMachineStats) return;
});
async function tick() { async function tick() {
const cpu = await cpuUsage(); const cpu = await cpuUsage();

View File

@ -45,7 +45,7 @@ export default define(meta, paramDef, async (ps, me) => {
); );
return await Users.packMany( return await Users.packMany(
users.filter((x) => x !== undefined) as User[], users.filter((x) => (x != null)) as User[],
me, me,
{ detail: true }, { detail: true },
); );