This repository was archived by the owner on Oct 1, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 7 files changed +21
-18
lines changed
Expand file tree Collapse file tree 7 files changed +21
-18
lines changed Original file line number Diff line number Diff line change @@ -113,7 +113,7 @@ Module | Topic | Video | Codelab | START here | FINISH here
11311314|Migrate service between projects| _ TBD_ | _ TBD_ | _ TBD_ | _ TBD_
11411415|Add App Engine ` blobstore ` | _ TBD_ | [ link] ( https://codelabs.developers.google.com/codelabs/cloud-gae-python-migrate-15-blobstore?utm_source=codelabs&utm_medium=et&utm_campaign=CDR_wes_aap-serverless_mgrblobstore_sms_202029&utm_content=- ) | Module 0 [ code] ( /mod0-baseline ) (2.x) | Module 15 [ code] ( /mod15-blobstore ) (2.x)
11511516|Migrate to Cloud Storage| _ TBD_ | [ link] ( https://codelabs.developers.google.com/codelabs/cloud-gae-python-migrate-16-cloudstorage?utm_source=codelabs&utm_medium=et&utm_campaign=CDR_wes_aap-serverless_mgrcloudstorage_sms_202029&utm_content=- ) | Module 15 [ code] ( /mod15-blobstore ) (2.x) | Module 16 [ code] ( /mod16-cloudstorage ) (2.x & 3.x)
116- 17|Migrate to Python 3 bundled services| _ TBD_ | _ TBD _ | Module 1 [ code] ( /mod1-flask ) (2.x) | Module 1 [ code] ( /mod1b-flask ) (3.x)
116+ 17|Migrate to Python 3 bundled services| _ TBD_ | [ link ] ( http://codelabs.developers.google.com/codelabs/cloud-gae-python-migrate-17-bundled?utm_source=codelabs&utm_medium=et&utm_campaign=CDR_wes_aap-serverless_mgrwormhole_sms_202002&utm_content=- ) | Module 1 [ code] ( /mod1-flask ) (2.x) | Module 1 [ code] ( /mod1b-flask ) (3.x)
11711718|Add App Engine ` taskqueue ` pull tasks| _ TBD_ | _ TBD_ | Module 1 [ code] ( /mod1-flask ) (2.x) | Module 18 [ code] ( /mod18-gaepull ) (2.x)
11811819|Migrate to Cloud Pub/Sub| _ TBD_ | _ TBD_ | Module 18 [ code] ( /mod18-gaepull ) (2.x) | Module 19 [ code] ( /mod9-pubsub ) (3.x)
119119
Original file line number Diff line number Diff line change @@ -22,9 +22,9 @@ handlers:
2222
2323libraries :
2424- name : grpcio
25- version : 1.0.0
25+ version : latest
2626- name : setuptools
27- version : 36.6.0
27+ version : latest
2828
2929env_variables :
3030 REDIS_HOST : ' YOUR_REDIS_HOST'
Original file line number Diff line number Diff line change @@ -58,7 +58,8 @@ def log_visitors():
5858 for task in tasks :
5959 visitor = task .payload
6060 tallies [visitor ] = tallies .get (visitor , 0 ) + 1
61- q .delete_tasks (tasks )
61+ if tasks :
62+ q .delete_tasks (tasks )
6263
6364 # increment those counts in Datastore and return
6465 for visitor in tallies :
Original file line number Diff line number Diff line change @@ -70,17 +70,19 @@ def log_visitors():
7070 acks .add (rcvd_msg .ack_id )
7171 visitor = rcvd_msg .message .data .decode ('utf-8' )
7272 tallies [visitor ] = tallies .get (visitor , 0 ) + 1
73- psc_client .acknowledge (subscription = SUB_PATH , ack_ids = acks )
73+ if acks :
74+ psc_client .acknowledge (subscription = SUB_PATH , ack_ids = acks )
7475
7576 # increment those counts in Datastore and return
76- with ds_client .context ():
77- for visitor in tallies :
78- counter = VisitorCount .query (VisitorCount .visitor == visitor ).get ()
79- if not counter :
80- counter = VisitorCount (visitor = visitor , counter = 0 )
77+ if tallies :
78+ with ds_client .context ():
79+ for visitor in tallies :
80+ counter = VisitorCount .query (VisitorCount .visitor == visitor ).get ()
81+ if not counter :
82+ counter = VisitorCount (visitor = visitor , counter = 0 )
83+ counter .put ()
84+ counter .counter += tallies [visitor ]
8185 counter .put ()
82- counter .counter += tallies [visitor ]
83- counter .put ()
8486 return 'DONE (with %d task[s] logging %d visitor[s])\r \n ' % (len (msgs ), len (tallies ))
8587
8688
Original file line number Diff line number Diff line change @@ -22,6 +22,6 @@ handlers:
2222
2323libraries :
2424- name : grpcio
25- version : 1.0.0
25+ version : latest
2626- name : setuptools
27- version : 36.6.0
27+ version : latest
Original file line number Diff line number Diff line change @@ -22,6 +22,6 @@ handlers:
2222
2323libraries :
2424- name : grpcio
25- version : 1.0.0
25+ version : latest
2626- name : setuptools
27- version : 36.6.0
27+ version : latest
Original file line number Diff line number Diff line change @@ -22,6 +22,6 @@ handlers:
2222
2323libraries :
2424- name : grpcio
25- version : 1.0.0
25+ version : latest
2626- name : setuptools
27- version : 36.6.0
27+ version : latest
You can’t perform that action at this time.
0 commit comments