Skip to content

Commit

Permalink
Ajuste na ENV do mongo.
Browse files Browse the repository at this point in the history
  • Loading branch information
tharlestsa committed Sep 27, 2024
1 parent 4ccd648 commit a6ab6d8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/server/integration/py/publish_layers.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/python3

import os
import sys
import ee
import json
Expand All @@ -8,6 +9,8 @@
import glob
from pymongo import MongoClient

MONGO_URL = os.getenv('MONGO_URL')

CREDENTIALS_DIR = sys.argv[1]
MONGO_HOST = sys.argv[2]
MONGO_PORT = int(sys.argv[3])
Expand Down Expand Up @@ -164,7 +167,7 @@ def processPeriod(tiles, periods, suffix = ''):
else:
print(mosaicId + ' exists and is valid.')

client = MongoClient(MONGO_HOST, MONGO_PORT)
client = MongoClient(MONGO_URL)
db = client.tvi

gee_multi_credentials(CREDENTIALS_DIR)
Expand Down
6 changes: 4 additions & 2 deletions src/server/integration/py/update_mosaic_date.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
#!/usr/bin/python

import os
import sys
import ee
import datetime
import json
from pymongo import MongoClient

MONGO_URL = os.getenv('MONGO_URL')

#convert crop.jpg -channel RGB -contrast-stretch 0.1x0.1% crop.png
EE_PRIVATE_KEY_FILE = sys.argv[1]
data = json.load(open(EE_PRIVATE_KEY_FILE))
Expand Down Expand Up @@ -99,7 +101,7 @@ def getExpirationDate():
now = datetime.datetime.now()
return datetime.datetime(now.year, now.month, now.day) + datetime.timedelta(hours=24)

client = MongoClient('172.18.0.6', 27017)
client = MongoClient(MONGO_URL)
db = client.tvi

SATELLITES = [ 'L8', 'L7', 'L5' ]
Expand Down

0 comments on commit a6ab6d8

Please sign in to comment.