Compare commits

...

24 Commits
5.5.0 ... 5.6.1

Author SHA1 Message Date
12f63db62e 5.6.1 2018-07-27 18:52:07 +09:00
08e1c87fa6 oops 2018-07-27 18:50:15 +09:00
8ee962b729 5.6.0 2018-07-27 18:43:36 +09:00
3d8b45ecdd Use os-utils 2018-07-27 18:42:58 +09:00
2347d9cea2 Merge branch 'master' of https://github.com/syuilo/misskey 2018-07-27 18:40:41 +09:00
8a57f490ce バギーなのでジョブキュー無効化 2018-07-27 18:40:38 +09:00
a880f5cbb8 Merge pull request #2009 from acid-chicken/acid-chicken-patch-1
Minify Mk-II
2018-07-27 18:29:24 +09:00
df5a7c7e0c Update calendar.vue 2018-07-27 18:28:06 +09:00
b7b82456d8 Merge branch 'master' of https://github.com/syuilo/misskey 2018-07-27 18:18:49 +09:00
6b19e54c23 Fix bug 2018-07-27 18:18:05 +09:00
75d04858e6 2018-07-27 17:58:19 +09:00
9332551791 2018-07-27 17:51:40 +09:00
32117a573b Fix bug 2018-07-27 17:47:10 +09:00
d4d3316d18 2018-07-27 17:43:04 +09:00
2vg
43a7eb233c fix: critical memory leak. 2018-07-27 17:33:21 +09:00
2vg
178093861b memory usage excludes buffer and cache. 2018-07-27 17:31:19 +09:00
3fb26534b7 Merge pull request #2004 from syuilo/greenkeeper/jsdom-11.12.0
Update jsdom to the latest version 🚀
2018-07-27 14:48:59 +09:00
19a9fdfd38 fix(package): update jsdom to version 11.12.0 2018-07-27 04:58:58 +00:00
6438e97324 Merge pull request #2002 from yuzulabo/fix/visibility-icon-mobile
#1993 をモバイル版に対応
2018-07-27 13:37:45 +09:00
b29492e8eb Change VisibilityButton's icon in mobile view 2018-07-27 13:30:46 +09:00
5ab4f10230 fix(package): update typescript-eslint-parser to version 17.0.1 2018-07-27 09:39:21 +09:00
80b251e12c Merge branch 'master' of https://github.com/syuilo/misskey 2018-07-27 07:29:26 +09:00
bfd8b12a4f Clean up 2018-07-27 07:29:24 +09:00
1c2e94658b Update README.md 2018-07-27 07:21:03 +09:00
10 changed files with 71 additions and 58 deletions

View File

@ -43,9 +43,9 @@ If you want to...
:heart: Backers & Sponsors :heart: Backers & Sponsors
---------------------------------------------------------------- ----------------------------------------------------------------
| <img src="https://c10.patreonusercontent.com/3/eyJoIjoxMDAsInciOjEwMH0%3D/patreon-media/p/user/619786/32cf01444db24e578cd1982c197f6fc6/1?token-time=2145916800&token-hash=tB1e_r8RlZ5sFL0KV_e8dugapxatNBRK1Z3h67TO1g8%3D"> | <img src="https://c10.patreonusercontent.com/3/eyJoIjoxMDAsInciOjEwMH0%3D/patreon-media/p/user/12378075/0156f769e20f412594fa6b87d85fe228/1?token-time=2145916800&token-hash=IsIJRUXszzoD6-7pDnRY8I05T9nSznc4GTaxj7C9SwU%3D"> | <img src="https://c10.patreonusercontent.com/3/eyJoIjoxMDAsInciOjEwMH0%3D/patreon-media/p/user/4503830/ccf2cc867ea64de0b524bb2e24b9a1cb/1?token-time=2145916800&token-hash=S1zP0QyLU52Dqq6dtc9qNYyWfW86XrYHiR4NMbeOrnA%3D"> | | <img src="https://c10.patreonusercontent.com/3/eyJoIjoxMDAsInciOjEwMH0%3D/patreon-media/p/user/619786/32cf01444db24e578cd1982c197f6fc6/1?token-time=2145916800&token-hash=tB1e_r8RlZ5sFL0KV_e8dugapxatNBRK1Z3h67TO1g8%3D"> | <img src="https://c10.patreonusercontent.com/3/eyJoIjoxMDAsInciOjEwMH0%3D/patreon-media/p/user/12378075/0156f769e20f412594fa6b87d85fe228/1?token-time=2145916800&token-hash=IsIJRUXszzoD6-7pDnRY8I05T9nSznc4GTaxj7C9SwU%3D"> | <img src="https://c10.patreonusercontent.com/3/eyJoIjoxMDAsInciOjEwMH0%3D/patreon-media/p/user/4503830/ccf2cc867ea64de0b524bb2e24b9a1cb/1?token-time=2145916800&token-hash=S1zP0QyLU52Dqq6dtc9qNYyWfW86XrYHiR4NMbeOrnA%3D"> | <img src="https://c10.patreonusercontent.com/3/eyJoIjoxMDAsInciOjEwMH0%3D/patreon-media/p/user/12531784/93a45137841849329ba692da92ac7c60/1?token-time=2145916800&token-hash=tMosUojzUYJCH_3t--tvYA-SMCyrS__hzSndyaRSnbo%3D"> |
|:-:|:-:|:-:| |:-:|:-:|:-:|:-:|
| [Gargron](https://www.patreon.com/mastodon) | [39ff](https://www.patreon.com/user/creators?u=12378075) | [dansup](https://www.patreon.com/dansup) | | [Gargron](https://www.patreon.com/mastodon) | [39ff](https://www.patreon.com/user/creators?u=12378075) | [dansup](https://www.patreon.com/dansup) | [Takashi Shibuya](https://www.patreon.com/user/creators?u=12531784) |
:four_leaf_clover: Copyright :four_leaf_clover: Copyright
---------------------------------------------------------------- ----------------------------------------------------------------

View File

@ -1,8 +1,8 @@
{ {
"name": "misskey", "name": "misskey",
"author": "syuilo <i@syuilo.com>", "author": "syuilo <i@syuilo.com>",
"version": "5.5.0", "version": "5.6.1",
"clientVersion": "1.0.7602", "clientVersion": "1.0.7624",
"codename": "nighthike", "codename": "nighthike",
"main": "./built/index.js", "main": "./built/index.js",
"private": true, "private": true,
@ -75,6 +75,7 @@
"@types/showdown": "1.7.5", "@types/showdown": "1.7.5",
"@types/single-line-log": "1.1.0", "@types/single-line-log": "1.1.0",
"@types/speakeasy": "2.0.2", "@types/speakeasy": "2.0.2",
"@types/systeminformation": "3.23.0",
"@types/tmp": "0.0.33", "@types/tmp": "0.0.33",
"@types/uuid": "3.4.3", "@types/uuid": "3.4.3",
"@types/webpack": "4.4.8", "@types/webpack": "4.4.8",
@ -131,7 +132,7 @@
"is-url": "1.2.4", "is-url": "1.2.4",
"jquery": "3.3.1", "jquery": "3.3.1",
"js-yaml": "3.12.0", "js-yaml": "3.12.0",
"jsdom": "11.11.0", "jsdom": "11.12.0",
"koa": "2.5.1", "koa": "2.5.1",
"koa-bodyparser": "4.2.1", "koa-bodyparser": "4.2.1",
"koa-compress": "3.0.0", "koa-compress": "3.0.0",
@ -187,6 +188,7 @@
"stylus": "0.54.5", "stylus": "0.54.5",
"stylus-loader": "3.0.2", "stylus-loader": "3.0.2",
"summaly": "2.0.6", "summaly": "2.0.6",
"systeminformation": "3.42.4",
"syuilo-password-strength": "0.0.1", "syuilo-password-strength": "0.0.1",
"textarea-caret": "3.1.0", "textarea-caret": "3.1.0",
"tmp": "0.0.33", "tmp": "0.0.33",
@ -194,7 +196,7 @@
"ts-node": "7.0.0", "ts-node": "7.0.0",
"tslint": "5.10.0", "tslint": "5.10.0",
"typescript": "2.9.2", "typescript": "2.9.2",
"typescript-eslint-parser": "17.0.0", "typescript-eslint-parser": "17.0.1",
"uglify-es": "3.3.9", "uglify-es": "3.3.9",
"url-loader": "1.0.1", "url-loader": "1.0.1",
"uuid": "3.3.2", "uuid": "3.3.2",

View File

@ -102,7 +102,6 @@ export default Vue.extend({
}, },
methods: { methods: {
onStats(stats) { onStats(stats) {
stats.mem.used = stats.mem.total - stats.mem.free;
this.stats.push(stats); this.stats.push(stats);
if (this.stats.length > 50) this.stats.shift(); if (this.stats.length > 50) this.stats.shift();

View File

@ -35,7 +35,7 @@ export default Vue.extend({
}, },
methods: { methods: {
onStats(stats) { onStats(stats) {
stats.mem.used = stats.mem.total - stats.mem.free; stats.mem.free = stats.mem.total - stats.mem.used;
this.usage = stats.mem.used / stats.mem.total; this.usage = stats.mem.used / stats.mem.total;
this.total = stats.mem.total; this.total = stats.mem.total;
this.used = stats.mem.used; this.used = stats.mem.used;

View File

@ -35,7 +35,7 @@ import Vue from 'vue';
const eachMonthDays = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; const eachMonthDays = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
function isLeapYear(year) { function isLeapYear(year) {
return !(year % (year % 25 ? 4 : 16)); return !(year & (year % 25 ? 3 : 5));
} }
export default Vue.extend({ export default Vue.extend({

View File

@ -34,7 +34,13 @@
<button class="poll" @click="poll = true">%fa:chart-pie%</button> <button class="poll" @click="poll = true">%fa:chart-pie%</button>
<button class="poll" @click="useCw = !useCw">%fa:eye-slash%</button> <button class="poll" @click="useCw = !useCw">%fa:eye-slash%</button>
<button class="geo" @click="geo ? removeGeo() : setGeo()">%fa:map-marker-alt%</button> <button class="geo" @click="geo ? removeGeo() : setGeo()">%fa:map-marker-alt%</button>
<button class="visibility" @click="setVisibility" ref="visibilityButton">%fa:lock%</button> <button class="visibility" @click="setVisibility" ref="visibilityButton">
<span v-if="visibility === 'public'">%fa:globe%</span>
<span v-if="visibility === 'home'">%fa:home%</span>
<span v-if="visibility === 'followers'">%fa:unlock%</span>
<span v-if="visibility === 'specified'">%fa:envelope%</span>
<span v-if="visibility === 'private'">%fa:lock%</span>
</button>
</footer> </footer>
<input ref="file" class="file" type="file" accept="image/*" multiple="multiple" @change="onChangeFile"/> <input ref="file" class="file" type="file" accept="image/*" multiple="multiple" @change="onChangeFile"/>
</div> </div>

View File

@ -1,7 +1,8 @@
import * as os from 'os'; import * as os from 'os';
const osUtils = require('os-utils'); import * as sysUtils from 'systeminformation';
import * as diskusage from 'diskusage'; import * as diskusage from 'diskusage';
import Xev from 'xev'; import Xev from 'xev';
const osUtils = require('os-utils');
const ev = new Xev(); const ev = new Xev();
@ -18,25 +19,58 @@ export default function() {
}); });
async function tick() { async function tick() {
osUtils.cpuUsage((cpuUsage: number) => { const cpu = await cpuUsage();
const disk = diskusage.checkSync(os.platform() == 'win32' ? 'c:' : '/'); const usedmem = await usedMem();
const stats = { const totalmem = await totalMem();
cpu_usage: cpuUsage, const disk = diskusage.checkSync(os.platform() == 'win32' ? 'c:' : '/');
mem: {
total: os.totalmem(), const stats = {
free: os.freemem() cpu_usage: cpu,
}, mem: {
disk, total: totalmem,
os_uptime: os.uptime(), used: usedmem
process_uptime: process.uptime() },
}; disk,
ev.emit('serverStats', stats); os_uptime: os.uptime(),
log.push(stats); process_uptime: process.uptime()
if (log.length > 50) log.shift(); };
}); ev.emit('serverStats', stats);
log.push(stats);
if (log.length > 50) log.shift();
} }
tick(); tick();
setInterval(tick, interval); setInterval(tick, interval);
} }
// CPU STAT
function cpuUsage() {
return new Promise((res, rej) => {
osUtils.cpuUsage((cpuUsage: number) => {
res(cpuUsage);
});
});
}
// MEMORY(excl buffer + cache) STAT
async function usedMem() {
try {
const data = await sysUtils.mem();
return data.active;
} catch (error) {
console.error(error);
throw error;
}
}
// TOTAL MEMORY STAT
async function totalMem() {
try {
const data = await sysUtils.mem();
return data.total;
} catch (error) {
console.error(error);
throw error;
}
}

View File

@ -79,9 +79,6 @@ async function workerMain() {
// start server // start server
await require('./server').default(); await require('./server').default();
// start processor
require('./queue').default();
// Send a 'ready' message to parent process // Send a 'ready' message to parent process
process.send('ready'); process.send('ready');
} }

View File

@ -1,28 +1,8 @@
import * as Queue from 'bee-queue';
import config from '../config';
import http from './processors/http'; import http from './processors/http';
import { ILocalUser } from '../models/user'; import { ILocalUser } from '../models/user';
const queue = new Queue('misskey', {
redis: {
port: config.redis.port,
host: config.redis.host,
password: config.redis.pass
},
removeOnSuccess: true,
removeOnFailure: true,
getEvents: false,
sendEvents: false,
storeJobs: false
});
export function createHttpJob(data: any) { export function createHttpJob(data: any) {
return queue.createJob(data) return http({ data }, () => {});
//.retries(4)
//.backoff('exponential', 16384) // 16s
.save();
} }
export function deliver(user: ILocalUser, content: any, to: any) { export function deliver(user: ILocalUser, content: any, to: any) {
@ -33,7 +13,3 @@ export function deliver(user: ILocalUser, content: any, to: any) {
to to
}); });
} }
export default function() {
queue.process(128, http);
}

View File

@ -10,8 +10,7 @@ export default async (me: mongodb.ObjectID, note: object) => {
// if watching now // if watching now
const exist = await Watching.findOne({ const exist = await Watching.findOne({
noteId: (note as any)._id, noteId: (note as any)._id,
userId: me, userId: me
deletedAt: { $exists: false }
}); });
if (exist !== null) { if (exist !== null) {