Skip to content

Commit 34b64a9

Browse files
committed
fixed from query
1 parent 7cbad9b commit 34b64a9

8 files changed

+23
-4
lines changed

cad-creation-automation

-8 Bytes
Binary file not shown.

cad-creation-automation-32.exe

0 Bytes
Binary file not shown.

cad-creation-automation.exe

512 Bytes
Binary file not shown.

cad-creation-automation.log

+8
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,11 @@
1212
2022/08/07 20:06:12 Processing 0 messages...
1313
2022/08/07 20:06:12 Checking USB
1414
2022/08/07 20:06:12 0 USB Devices Found
15+
2022/08/07 21:02:40 Starting the process 2022-08-07 21:02:40.4884869 +0530 IST my-computer
16+
2022/08/07 21:02:42 email address is [email protected]
17+
2022/08/07 21:02:58 Starting the process 2022-08-07 21:02:58.0375188 +0530 IST my-computer
18+
2022/08/07 21:02:59 email address is [email protected]
19+
2022/08/07 21:03:22 Starting the process 2022-08-07 21:03:22.3569625 +0530 IST my-computer
20+
2022/08/07 21:03:23 email address is [email protected]
21+
2022/08/07 21:09:17 Starting the process 2022-08-07 21:09:17.2385583 +0530 IST my-computer
22+
2022/08/07 21:09:18 email address is [email protected]

config.yaml

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@ name: my-computer
22
notifierEmail: [email protected]
33
checks:
44
5-
path: /home/sharad/personal/cad-creation-automation/cader
5+
path: /home/sharad/personal/cad-creation-automation/cader
6+
7+
path: /home/sharad/personal/cad-creation-automation/cader2

main.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ func main() {
114114

115115
fromClause := ""
116116
for _, cc := range c.Checks {
117-
fromClause += cc.Email + ","
117+
fromClause += cc.Email + " OR "
118118
}
119-
fromClause = strings.TrimSuffix(fromClause, ",")
119+
fromClause = strings.TrimSuffix(fromClause, " OR ")
120120

121121
tick := time.NewTicker(30 * time.Second)
122122
defer tick.Stop()
@@ -129,10 +129,11 @@ func main() {
129129

130130
log.Println("email address is ", profile.EmailAddress)
131131

132+
query := fmt.Sprintf("from:(%s),label:(inbox,-cad-creation-automation),newer_than:2d", fromClause)
133+
log.Println("query", query)
132134
for range tick.C {
133135

134136
// process 2 days message
135-
query := fmt.Sprintf("from:%s,label:(inbox,-cad-creation-automation),newer_than:2d", fromClause)
136137
req := srv.Users.Messages.List("me").Q(query)
137138
// if pageToken != "" {
138139
// req.PageToken(pageToken)

readme.md

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ GOOS=windows GOARCH=amd64 go build -o cad-creation-automation.exe
66
32 bit
77
GOOS=windows GOARCH=386 go build -o cad-creation-automation-32.exe
88

9+
Linux
10+
go build
11+
912
# Running
1013

1114
The binary can only be run where the config & credential & token file is located

script.sh

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
3+
GOOS=windows GOARCH=amd64 go build -o cad-creation-automation.exe
4+
GOOS=windows GOARCH=386 go build -o cad-creation-automation-32.exe
5+
go build

0 commit comments

Comments
 (0)