Skip to content

Commit

Permalink
label: add more bot (X-lab2017#1615)
Browse files Browse the repository at this point in the history
Signed-off-by: frank-zsy <[email protected]>
  • Loading branch information
frank-zsy authored Sep 2, 2024
1 parent dfc2f8d commit e5163f1
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 5 deletions.
34 changes: 34 additions & 0 deletions labeled_data/bot/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1453,6 +1453,40 @@ data:
name: GateQuality
- id: 63350304
name: jdlab-dev
- id: 104070462
name: amir1387aht
- id: 115764622
name: seeronline
- id: 15693930
name: KrissV2
- id: 64667029
name: rickdoq
- id: 170894649
name: Wanderx13
- id: 88782659
name: WSA1k
- id: 175113066
name: swaggy111
- id: 32580384
name: c0ffincolors
- id: 89100268
name: llowvxe
- id: 55325034
name: jia6214876
- id: 156702024
name: ioBroker-Bot
- id: 114004748
name: cingmanwu
- id: 31872143
name: TL-Yao
- id: 57792770
name: ytl2019
- id: 3389845
name: PiaoR
- id: 58259069
name: bambootest-bot
- id: 87254977
name: ahmar7
- name: Gitee
type: Code Hosting
users:
Expand Down
6 changes: 4 additions & 2 deletions src/cron/tasks/community_openrank.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { query as queryNeo4j, queryStream as queryStreamNeo4j } from '../../db/n
import { Readable } from 'stream';
import { join } from 'path';
import getConfig from '../../config';
import { readFileSync, writeFileSync } from 'fs';
import { mkdirSync, readFileSync, writeFileSync } from 'fs';

enum CalcStatus {
Normal = 1,
Expand Down Expand Up @@ -317,7 +317,9 @@ GROUP BY
const saveExportData = async (param: { platform: string, exportData: any }) => {
const { platform, exportData } = param;
const repoName = exportData.meta.repoName;
const exportFilePath = join(config.export.path, platform.toLowerCase(), repoName, 'community_openrank.json');
const exportFileDir = join(config.export.path, platform.toLowerCase(), repoName);
const exportFilePath = join(exportFileDir, 'community_openrank.json');
mkdirSync(exportFileDir, { recursive: true });
let data: ExportDataType = {
meta: {
repoId: +exportData.meta.repoId,
Expand Down
2 changes: 1 addition & 1 deletion src/cron/tasks/global_openrank.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const task: Task = {
}
if (parseInt(checkResult[0][0]) > 0) {
logger.info(`Results of global openrank for ${yyyymm} already exists, skip.`);
return;
return true;
}
logger.info(`Start to calculate the global_openrank table for ${yyyymm}.`);

Expand Down
5 changes: 3 additions & 2 deletions src/cron/tasks/monthly_export.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-nocheck
import { appendFileSync, existsSync, mkdirSync, readFileSync, writeFileSync } from 'fs';
import { join } from 'path';
import { Task } from '..';
Expand Down Expand Up @@ -482,11 +483,11 @@ const task: Task = {
const exportUserInfo = async () => {
let processedCount = 0;
const userInfoQuery = `SELECT platform, b.actor_login, a.location, a.bio, a.name, a.company FROM
(SELECT CAST('GitHub','Enum8(\\\'GitHub\\\'=1)') AS platform, id, location, bio, name, company FROM gh_user_info WHERE status='normal' AND id IN (SELECT id IN ${exportUserTableName} WHERE platform='GitHub'))a
(SELECT CAST('GitHub','Enum8(\\\'GitHub\\\'=1)') AS platform, id, location, bio, name, company FROM gh_user_info WHERE status='normal' AND id IN (SELECT id FROM ${exportUserTableName} WHERE platform='GitHub'))a
LEFT JOIN
(SELECT id, platform, actor_login FROM ${exportUserTableName})b
ON a.id = b.id AND a.platform = b.platform
LIMIT 1 BY b.actor_id`;
LIMIT 1 BY b.id`;
await queryStream(userInfoQuery, row => {
const [platform, login, location, bio, name, company] = row;
updateMetaData(join(exportBasePath, platform.toLowerCase(), login, 'meta.json'), {
Expand Down

0 comments on commit e5163f1

Please sign in to comment.