Skip to content

Commit

Permalink
10.102.1-l190423011206
Browse files Browse the repository at this point in the history
  • Loading branch information
mei23 committed Apr 22, 2019
2 parents 9624702 + 692ff16 commit 398b6d9
Show file tree
Hide file tree
Showing 12 changed files with 33 additions and 48 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "misskey",
"author": "syuilo <[email protected]>",
"version": "10.102.1-l190422062912",
"version": "10.102.1-l190423011206",
"codename": "nighthike",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion src/client/app/common/views/components/reaction-picker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default Vue.extend({
faRandom,
title: this.$t('choose-reaction'),
text: null,
enableEmojiReaction: false,
enableEmojiReaction: true,
};
},
Expand Down
17 changes: 11 additions & 6 deletions src/client/app/common/views/components/settings/profile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -291,12 +291,17 @@ export default Vue.extend({
this.exportTarget == 'mute' ? 'i/export-mute' :
this.exportTarget == 'blocking' ? 'i/export-blocking' :
this.exportTarget == 'user-lists' ? 'i/export-user-lists' :
null, {});
this.$root.dialog({
type: 'info',
text: this.$t('export-requested')
});
null, {}).then(() => {
this.$root.dialog({
type: 'info',
text: this.$t('export-requested')
});
}).catch((e: any) => {
this.$root.dialog({
type: 'error',
text: e.message
});
});
},
doImport() {
Expand Down
6 changes: 3 additions & 3 deletions src/client/app/common/views/components/time.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export default Vue.extend({
},
relative(): string {
const time = this._time;
if (time == null) return this.$t('@.time.unknown');
const ago = (this.now.getTime() - time.getTime()) / 1000/*ms*/;
return (
ago >= 31536000 ? this.$t('@.time.years_ago') .replace('{}', (~~(ago / 31536000)).toString()) :
Expand All @@ -46,9 +47,8 @@ export default Vue.extend({
ago >= 3600 ? this.$t('@.time.hours_ago') .replace('{}', (~~(ago / 3600)).toString()) :
ago >= 60 ? this.$t('@.time.minutes_ago').replace('{}', (~~(ago / 60)).toString()) :
ago >= 10 ? this.$t('@.time.seconds_ago').replace('{}', (~~(ago % 60)).toString()) :
ago >= -1 ? this.$t('@.time.just_now') :
ago < -1 ? this.$t('@.time.future') :
this.$t('@.time.unknown'));
ago >= -10 ? this.$t('@.time.just_now') :
this.$t('@.time.future'));
}
},
created() {
Expand Down
16 changes: 4 additions & 12 deletions src/daemons/server-stats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,12 @@ function cpuUsage() {

// MEMORY(excl buffer + cache) STAT
async function usedMem() {
try {
const data = await sysUtils.mem();
return data.active;
} catch (error) {
throw error;
}
const data = await sysUtils.mem();
return data.active;
}

// TOTAL MEMORY STAT
async function totalMem() {
try {
const data = await sysUtils.mem();
return data.total;
} catch (error) {
throw error;
}
const data = await sysUtils.mem();
return data.total;
}
14 changes: 7 additions & 7 deletions src/prelude/maybe.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
export interface Maybe<T> {
isJust(): this is Just<T>;
export interface IMaybe<T> {
isJust(): this is IJust<T>;
}

export type Just<T> = Maybe<T> & {
get(): T
};
export interface IJust<T> extends IMaybe<T> {
get(): T;
}

export function just<T>(value: T): Just<T> {
export function just<T>(value: T): IJust<T> {
return {
isJust: () => true,
get: () => value
};
}

export function nothing<T>(): Maybe<T> {
export function nothing<T>(): IMaybe<T> {
return {
isJust: () => false,
};
Expand Down
4 changes: 1 addition & 3 deletions src/queue/processors/db/delete-drive-files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@ export async function deleteDriveFiles(job: Bull.Job, done: any): Promise<void>
});

let deletedCount = 0;
let ended = false;
let cursor: any = null;

while (!ended) {
while (true) {
const files = await DriveFile.find({
userId: user._id,
...(cursor ? { _id: { $gt: cursor } } : {})
Expand All @@ -31,7 +30,6 @@ export async function deleteDriveFiles(job: Bull.Job, done: any): Promise<void>
});

if (files.length === 0) {
ended = true;
job.progress(100);
break;
}
Expand Down
4 changes: 1 addition & 3 deletions src/queue/processors/db/export-blocking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,9 @@ export async function exportBlocking(job: Bull.Job, done: any): Promise<void> {
const stream = fs.createWriteStream(path, { flags: 'a' });

let exportedCount = 0;
let ended = false;
let cursor: any = null;

while (!ended) {
while (true) {
const blockings = await Blocking.find({
blockerId: user._id,
...(cursor ? { _id: { $gt: cursor } } : {})
Expand All @@ -47,7 +46,6 @@ export async function exportBlocking(job: Bull.Job, done: any): Promise<void> {
});

if (blockings.length === 0) {
ended = true;
job.progress(100);
break;
}
Expand Down
4 changes: 1 addition & 3 deletions src/queue/processors/db/export-following.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,9 @@ export async function exportFollowing(job: Bull.Job, done: any): Promise<void> {
const stream = fs.createWriteStream(path, { flags: 'a' });

let exportedCount = 0;
let ended = false;
let cursor: any = null;

while (!ended) {
while (true) {
const followings = await Following.find({
followerId: user._id,
...(cursor ? { _id: { $gt: cursor } } : {})
Expand All @@ -47,7 +46,6 @@ export async function exportFollowing(job: Bull.Job, done: any): Promise<void> {
});

if (followings.length === 0) {
ended = true;
job.progress(100);
break;
}
Expand Down
4 changes: 1 addition & 3 deletions src/queue/processors/db/export-mute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,9 @@ export async function exportMute(job: Bull.Job, done: any): Promise<void> {
const stream = fs.createWriteStream(path, { flags: 'a' });

let exportedCount = 0;
let ended = false;
let cursor: any = null;

while (!ended) {
while (true) {
const mutes = await Mute.find({
muterId: user._id,
...(cursor ? { _id: { $gt: cursor } } : {})
Expand All @@ -47,7 +46,6 @@ export async function exportMute(job: Bull.Job, done: any): Promise<void> {
});

if (mutes.length === 0) {
ended = true;
job.progress(100);
break;
}
Expand Down
4 changes: 1 addition & 3 deletions src/queue/processors/db/export-notes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,9 @@ export async function exportNotes(job: Bull.Job, done: any): Promise<void> {
});

let exportedNotesCount = 0;
let ended = false;
let cursor: any = null;

while (!ended) {
while (true) {
const notes = await Note.find({
userId: user._id,
...(cursor ? { _id: { $gt: cursor } } : {})
Expand All @@ -57,7 +56,6 @@ export async function exportNotes(job: Bull.Job, done: any): Promise<void> {
});

if (notes.length === 0) {
ended = true;
job.progress(100);
break;
}
Expand Down
4 changes: 1 addition & 3 deletions src/remote/activitypub/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default async (user: ILocalUser, url: string, object: any) => {
const addr = await resolveAddr(hostname);
if (!addr) return;

const _ = new Promise((resolve, reject) => {
await new Promise((resolve, reject) => {
const req = request({
protocol,
hostname: addr,
Expand Down Expand Up @@ -82,8 +82,6 @@ export default async (user: ILocalUser, url: string, object: any) => {
req.end(data);
});

await _;

//#region Log
publishApLogStream({
direction: 'out',
Expand Down

0 comments on commit 398b6d9

Please sign in to comment.