Skip to content

Commit bdb2e18

Browse files
committed
hot fix: 10 new projects warning
1 parent 1a404a2 commit bdb2e18

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

pegr/grails-app/services/pegr/QfileUploadService.groovy

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ class QfileUploadService {
2525
def warnings = []
2626
def newProjectCount = 0
2727
def MAX_NEW_PROJECT_COUNT = 10
28+
def projectNames = []
2829

2930
while ((rawdata = reader.readNext()) != null) {
3031
++lineNo
@@ -36,9 +37,13 @@ class QfileUploadService {
3637
cleanRawData(rawdata)
3738
def data = getNamedData(rawdata)
3839
def projectName = getProjectName(data.projectName, data.service, data.invoice)
39-
def project = Project.findByName(projectName)
40-
if (!project) {
41-
newProjectCount++
40+
if (!projectNames.contains(projectName)) {
41+
projectNames.push(projectName)
42+
43+
def project = Project.findByName(projectName)
44+
if (!project) {
45+
newProjectCount++
46+
}
4247
}
4348
}
4449
if (newProjectCount > MAX_NEW_PROJECT_COUNT) {

0 commit comments

Comments
 (0)