mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-20 16:42:56 +00:00
refactor: adjust code to updated dependencies
This commit is contained in:
@@ -16,16 +16,11 @@ import {asyncPool} from '@krlwlfrt/async-pool';
|
||||
import {Api} from '@openstapps/gitlab-api';
|
||||
import {Group, Project} from '@openstapps/gitlab-api/lib/types';
|
||||
import {Logger} from '@openstapps/logger';
|
||||
import {readFile, unlink, writeFile} from 'fs';
|
||||
import * as glob from 'glob';
|
||||
import {readFile, writeFile} from 'fs';
|
||||
import {promisify} from 'util';
|
||||
|
||||
export const readFilePromisified = promisify(readFile);
|
||||
export const globPromisified = promisify(glob);
|
||||
export const writeFilePromisified = promisify(writeFile);
|
||||
export const unlinkPromisified = promisify(unlink);
|
||||
|
||||
export const logger = new Logger();
|
||||
|
||||
/**
|
||||
* Get projects for a list of groups
|
||||
@@ -34,7 +29,7 @@ export const logger = new Logger();
|
||||
* @param groups List of groups
|
||||
*/
|
||||
export async function getProjects(api: Api, groups: number[]): Promise<Project[]> {
|
||||
logger.info('Fetching all projects for specified groups (' + groups.length + ')...');
|
||||
Logger.info('Fetching all projects for specified groups (' + groups.length + ')...');
|
||||
|
||||
const projectResults = await asyncPool(3, groups, (groupId) => {
|
||||
return api.getProjectsForGroup(groupId);
|
||||
@@ -42,7 +37,7 @@ export async function getProjects(api: Api, groups: number[]): Promise<Project[]
|
||||
|
||||
const projects = flatten2dArray(projectResults);
|
||||
|
||||
logger.log('Fetched ' + projects.length + ' project(s).');
|
||||
Logger.log('Fetched ' + projects.length + ' project(s).');
|
||||
|
||||
return projects;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user