clean file
This commit is contained in:
@@ -38,34 +38,81 @@ export class ContactsDataService {
|
||||
member_id: number,
|
||||
uid: string,
|
||||
sessionid: string,
|
||||
raw_contacts : any
|
||||
raw_contacts : string
|
||||
mmode: number,
|
||||
pcount: number
|
||||
};
|
||||
pPesult:any;
|
||||
async cacheContactsForAccount(contactResult){
|
||||
//alert('AAAA->001');
|
||||
this.usrData = {action:22010,
|
||||
/* this.usrData = {action:22010,
|
||||
member_id: this.sessionDataProviderService.member_id,
|
||||
uid: this.sessionDataProviderService.member_uid,
|
||||
sessionid: this.sessionDataProviderService.session ,
|
||||
raw_contacts: JSON.stringify(contactResult.contacts)
|
||||
raw_contacts: JSON.stringify(contactResult.contacts),
|
||||
|
||||
}
|
||||
|
||||
*/
|
||||
const myString = JSON.stringify(contactResult.contacts);
|
||||
alert(myString.length);
|
||||
alert(myString);
|
||||
|
||||
this.usrData = {action:22010,
|
||||
member_id: this.sessionDataProviderService.member_id,
|
||||
uid: this.sessionDataProviderService.member_uid,
|
||||
sessionid: this.sessionDataProviderService.session ,
|
||||
raw_contacts: myString
|
||||
}
|
||||
|
||||
this.wrenchService.processUsersContacts(this.usrData).subscribe(
|
||||
|
||||
let m1 = myString.substring(0,4000);
|
||||
let m2 = myString.substring(4000,8000);
|
||||
let m3 = myString.substring(8000);
|
||||
|
||||
const chunkSize = 3000;
|
||||
for(let ic=0; ic< myString.length; ic=ic+chunkSize){
|
||||
|
||||
this.usrData = {action:22010,
|
||||
member_id: this.sessionDataProviderService.member_id,
|
||||
uid: this.sessionDataProviderService.member_uid,
|
||||
sessionid: this.sessionDataProviderService.session ,
|
||||
raw_contacts: myString.substring(ic,ic+chunkSize),
|
||||
mmode: ic+chunkSize,
|
||||
pcount: myString.length
|
||||
}
|
||||
|
||||
await this.wrenchService.processUsersContacts(this.usrData).subscribe(
|
||||
pPesult => {
|
||||
this.pPesult = pPesult;
|
||||
console.log("pPesult RETURN->", this.pPesult);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
// this.usrData = {action:22010,
|
||||
// member_id: this.sessionDataProviderService.member_id,
|
||||
// uid: this.sessionDataProviderService.member_uid,
|
||||
// sessionid: this.sessionDataProviderService.session ,
|
||||
// raw_contacts: m1,
|
||||
// mmode: 1,
|
||||
// pcount: 3
|
||||
// }
|
||||
// this.usrData = {action:22010,
|
||||
// member_id: this.sessionDataProviderService.member_id,
|
||||
// uid: this.sessionDataProviderService.member_uid,
|
||||
// sessionid: this.sessionDataProviderService.session ,
|
||||
// raw_contacts: m2,
|
||||
// mmode: 1,
|
||||
// pcount: 3
|
||||
// }
|
||||
// this.usrData = {action:22010,
|
||||
// member_id: this.sessionDataProviderService.member_id,
|
||||
// uid: this.sessionDataProviderService.member_uid,
|
||||
// sessionid: this.sessionDataProviderService.session ,
|
||||
// raw_contacts: m1,
|
||||
// mmode: 2,
|
||||
// pcount: 3
|
||||
// }
|
||||
|
||||
// this.wrenchService.processUsersContacts(this.usrData).subscribe(
|
||||
// pPesult => {
|
||||
// this.pPesult = pPesult;
|
||||
// console.log("pPesult RETURN->", this.pPesult);
|
||||
// }
|
||||
// );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user