-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCach.js
111 lines (88 loc) · 1.74 KB
/
Cach.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
function myFunctiouuun() {
return ;
var start = (new Date()).getTime();
var arr = [] ;
var date = new Date();
var i =0 ;
while(++i<=300){
try{
getEvents(i,date);
arr.push(i)
}
catch(e)
{
}
}
Logger.log(arr.length);
Logger.log("Tim is: "+ ((new Date().getTime() - start)/1000 ) +" Second" );
}
//function myFunction() {
//
// try{
//
// throw {message:"Cache and S3 are aquals"};
//
// }
// catch(e)
// {
//
// var str = (e.message).toString();
// if((str.indexOf("NoSuchKey") !== -1) ||(str.indexOf("Cache and S3 are aquals") !== -1) )
// {
// Logger.log("Hello");
//
// Logger.log(e.message);
// }
//
// }
//}
//
//
//
//
//
//
//
//
//
//
//
//
//
//var cache = CacheService.getScriptCache();
//var subscriberId=16;
//var downloadedDate = new Date();
//downloadedDate.setDate(downloadedDate.getDate() - 5);
//
//var key = "Event/" + subscriberId + "/" + QMedicUtilities._convertDate(downloadedDate) + "/EventData.json";
//
//var jsonEventsFromS3 = getEvents(subscriberId, downloadedDate);
//var jsonEventsFromCache = QMedicEvents.getEvents(subscriberId, downloadedDate)
//if(JSON.stringify(jsonEventsFromS3) === JSON.stringify(jsonEventsFromCache))
//{
// Logger.log("They ar Equal ");
// // continue;
//}
//Logger.log("NotEqual");
//QMedicEvents.put_in_QMedicEvents_ScriptCache(key, JSON.stringify(jsonEventsFromS3))
//
//
//
//// if(jsonEventsFromCache===jsonEventsFromS3);
//// {
//// Logger.log("continue");
//// }
////
//
//
//
////cache.put(key, jsonEventsFromS3, QMedicConstants.TIME_IN_CACHE);
//
//
//
//
//function test()
//{
//
// QMedicEvents.put_in_QMedicEvents_ScriptCache("MM", "dWWAfaa");
//}