fix: Delete specific IPC channel for cache related APIs

This commit is contained in:
Misa Liu 2024-02-27 23:02:27 +08:00
parent 6548876c74
commit ededfe0f8c
No known key found for this signature in database
GPG Key ID: F70B23D0A4FED791

View File

@ -704,7 +704,6 @@ export class NTQQApi {
static async setCacheSilentScan(isSilent: boolean = true) { static async setCacheSilentScan(isSilent: boolean = true) {
return await callNTQQApi({ return await callNTQQApi({
channel: NTQQApiChannel.IPC_UP_3,
methodName: NTQQApiMethod.CACHE_SET_SILENCE, methodName: NTQQApiMethod.CACHE_SET_SILENCE,
args: [{ args: [{
isSilent isSilent
@ -714,7 +713,6 @@ export class NTQQApi {
static addCacheScannedPaths(pathMap: object = {}) { static addCacheScannedPaths(pathMap: object = {}) {
return callNTQQApi({ return callNTQQApi({
channel: NTQQApiChannel.IPC_UP_3,
methodName: NTQQApiMethod.CACHE_ADD_SCANNED_PATH, methodName: NTQQApiMethod.CACHE_ADD_SCANNED_PATH,
args: [{ args: [{
pathMap: {...pathMap}, pathMap: {...pathMap},
@ -724,12 +722,10 @@ export class NTQQApi {
static scanCache() { static scanCache() {
callNTQQApi<GeneralCallResult>({ callNTQQApi<GeneralCallResult>({
channel: NTQQApiChannel.IPC_UP_3,
methodName: ReceiveCmd.CACHE_SCAN_FINISH, methodName: ReceiveCmd.CACHE_SCAN_FINISH,
classNameIsRegister: true, classNameIsRegister: true,
}).then(); }).then();
return callNTQQApi<CacheScanResult>({ return callNTQQApi<CacheScanResult>({
channel: NTQQApiChannel.IPC_UP_3,
methodName: NTQQApiMethod.CACHE_SCAN, methodName: NTQQApiMethod.CACHE_SCAN,
args: [null, null], args: [null, null],
timeoutSecond: 300, timeoutSecond: 300,
@ -738,7 +734,6 @@ export class NTQQApi {
static getHotUpdateCachePath() { static getHotUpdateCachePath() {
return callNTQQApi<string>({ return callNTQQApi<string>({
channel: NTQQApiChannel.IPC_UP_3,
className: NTQQApiClass.HOTUPDATE_API, className: NTQQApiClass.HOTUPDATE_API,
methodName: NTQQApiMethod.CACHE_PATH_HOT_UPDATE methodName: NTQQApiMethod.CACHE_PATH_HOT_UPDATE
}); });
@ -746,7 +741,6 @@ export class NTQQApi {
static getDesktopTmpPath() { static getDesktopTmpPath() {
return callNTQQApi<string>({ return callNTQQApi<string>({
channel: NTQQApiChannel.IPC_UP_3,
className: NTQQApiClass.BUSINESS_API, className: NTQQApiClass.BUSINESS_API,
methodName: NTQQApiMethod.CACHE_PATH_DESKTOP_TEMP methodName: NTQQApiMethod.CACHE_PATH_DESKTOP_TEMP
}); });
@ -757,7 +751,6 @@ export class NTQQApi {
key: string, key: string,
value: string value: string
}[]>({ }[]>({
channel: NTQQApiChannel.IPC_UP_3,
className: NTQQApiClass.OS_API, className: NTQQApiClass.OS_API,
methodName: NTQQApiMethod.CACHE_PATH_SESSION, methodName: NTQQApiMethod.CACHE_PATH_SESSION,
}); });
@ -766,7 +759,6 @@ export class NTQQApi {
static clearCache(cacheKeys: Array<string> = [ 'tmp', 'hotUpdate' ]) { static clearCache(cacheKeys: Array<string> = [ 'tmp', 'hotUpdate' ]) {
console.log(cacheKeys); console.log(cacheKeys);
return callNTQQApi<any>({ return callNTQQApi<any>({
channel: NTQQApiChannel.IPC_UP_3,
methodName: NTQQApiMethod.CACHE_CLEAR, methodName: NTQQApiMethod.CACHE_CLEAR,
args: [{ args: [{
keys: cacheKeys keys: cacheKeys
@ -777,7 +769,6 @@ export class NTQQApi {
static getChatCacheList(type: 1 | 2, pageSize: number = 80, pageIndex: number = 0) { static getChatCacheList(type: 1 | 2, pageSize: number = 80, pageIndex: number = 0) {
return new Promise<ChatCacheList>((res, rej) => { return new Promise<ChatCacheList>((res, rej) => {
callNTQQApi<ChatCacheList>({ callNTQQApi<ChatCacheList>({
channel: NTQQApiChannel.IPC_UP_3,
methodName: NTQQApiMethod.CACHE_CHAT_GET, methodName: NTQQApiMethod.CACHE_CHAT_GET,
args: [{ args: [{
ChatType: type, ChatType: type,
@ -792,7 +783,6 @@ export class NTQQApi {
static async clearChatCache(chats: ChatCacheListItemBasic[] = [], fileKeys: unknown[] = []) { static async clearChatCache(chats: ChatCacheListItemBasic[] = [], fileKeys: unknown[] = []) {
return await callNTQQApi<GeneralCallResult>({ return await callNTQQApi<GeneralCallResult>({
channel: NTQQApiChannel.IPC_UP_3,
methodName: NTQQApiMethod.CACHE_CHAT_CLEAR, methodName: NTQQApiMethod.CACHE_CHAT_CLEAR,
args: [{ args: [{
chats, chats,