Skip to content
This repository was archived by the owner on Jan 23, 2025. It is now read-only.

Commit 2236bae

Browse files
committed
fixing bug that allowed limits of more than 100 records to be retrieved by the get top members api
1 parent 2598a5a commit 2236bae

File tree

10 files changed

+129
-6
lines changed

10 files changed

+129
-6
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ test/tmp/design_tmp_submissions/*.zip
1010
test/tmp/memberPhoto/*
1111
.idea
1212
.settings
13+
**/jdk-8u51-linux-x64.gz

actions/.challengeTypes.js.swp

16 KB
Binary file not shown.

actions/.challenges.js.swp

192 KB
Binary file not shown.

actions/tops.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -560,9 +560,6 @@ exports.getTopTrackMembers = {
560560
sqlParams.firstRowIndex = (pageIndex - 1) * pageSize;
561561
sqlParams.pageSize = pageSize;
562562

563-
if (trackType === "data") {
564-
sqlParams.pageSize = 2 * pageIndex * pageSize;
565-
}
566563
// Retrieves paged and ordered top members for the given track.
567564
api.dataAccess.executeQuery('get_top_members_' + trackType, sqlParams, dbConnectionMap, cb);
568565
}, function (rows, cb) {

deploy/.env.sh.swp

12 KB
Binary file not shown.

initializers/.dataAccess.js.swp

28 KB
Binary file not shown.

local/docker-compose.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
version: '2'
22
services:
3+
informix:
4+
image: appiriodevops/informix:1.2
5+
ports:
6+
- 2021:2021
37
tc-api:
4-
image: "node"
8+
build: ./node
9+
depends_on:
10+
- informix
511
ports:
6-
- "7777:7777"
12+
- "8080:8080"
13+
volumes:
14+
- ../:/tc-api
15+
command: /bin/bash -c "cd /tc-api && npm install && source local/env.sh && npm start && tail -f log/forever.log"

local/env.sh

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
#!/bin/bash
2+
3+
#
4+
# Copyright (C) 2013-2014 TopCoder Inc., All Rights Reserved.
5+
#
6+
# Version: 1.3
7+
# Author: vangavroche, isv, TCASSEMBLER
8+
# changes in 1.1:
9+
# - add JIRA_USERNAME and JIRA_PASSWORD
10+
# changes in 1.2:
11+
# - added RESET_PASSWORD_TOKEN_CACHE_EXPIRY environment variable
12+
# - added RESET_PASSWORD_TOKEN_EMAIL_SUBJECT environment variable
13+
# - added REDIS_HOST environment variable
14+
# - added REDIS_PORT environment variable
15+
# changes in 1.3
16+
# - added WKHTMLTOIMAGE_COMMAND_PATH environment variable
17+
# - added WKHTMLTOIMAGE_IMAGE_WIDTH environment variable
18+
# - added HIGHLIGHT_STYLE_LINK environment variable
19+
#
20+
21+
# tests rely on caching being off. But set this to a real value (or remove) while coding.
22+
export CACHE_EXPIRY=-1
23+
24+
VM_IP=informix
25+
if [ -n "$TC_VM_IP" ]
26+
then
27+
VM_IP=$TC_VM_IP
28+
fi
29+
30+
export TC_DB_NAME=informixoltp_tcp
31+
export TC_DB_HOST=$VM_IP
32+
export TC_DB_PORT=2021
33+
export TC_DB_USER=informix
34+
export TC_DB_PASSWORD=1nf0rm1x
35+
36+
export TC_DW_NAME=informixoltp_tcp
37+
export TC_DW_HOST=$VM_IP
38+
export TC_DW_PORT=2021
39+
export TC_DW_USER=informix
40+
export TC_DW_PASSWORD=1nf0rm1x
41+
42+
# oauth provider
43+
export TC_API_HOST=api.topcoder.com
44+
45+
# LDAP settings
46+
export TC_LDAP_HOST=$VM_IP
47+
export TC_LDAP_PORT=636
48+
export TC_LDAP_PASSWORD=secret
49+
export TC_LDAP_MEMBER_BASE_DN="ou=members, dc=topcoder, dc=com"
50+
export TC_BIND_DN="cn=Manager,dc=topcoder,dc=com"
51+
52+
# Mail settings
53+
export TC_EMAIL_HOST=smtp.gmail.com
54+
export TC_EMAIL_HOST_PORT=465
55+
export TC_EMAIL_SECURED=true
56+
export TC_EMAIL_ACCOUNT=tc.ldap.test.1@gmail.com
57+
export TC_EMAIL_PASSWORD=tc_public_email
58+
export TC_EMAIL_FROM=tc.ldap.test.1@gmail.com
59+
export TC_EMAIL_TEMPLATE_DIR=mail_templates
60+
61+
export TC_ACTIVATION_SERVER_NAME="https://www.topcoder.com"
62+
export TC_SOFTWARE_SERVER_NAME="https://software.topcoder.com"
63+
export TC_FORUMS_SERVER_NAME="http://apps.topcoder.com/forums"
64+
65+
export PASSWORD_HASH_KEY="ciTHHTSMg6ixffIuPbB30A=="
66+
## JDBC connection pool environment variables - set for all databases
67+
export MINPOOL=1
68+
export MAXPOOL=20
69+
export MAXSIZE=0
70+
export IDLETIMEOUT=3600
71+
export TIMEOUT=30000
72+
73+
# Used in Jira soap service (Bugs API)
74+
export JIRA_USERNAME=api_test
75+
export JIRA_PASSWORD=8CDDp6BHLtUeUdD
76+
77+
# Forum settings
78+
export STUDIO_FORUMS_SERVER_NAME="http://studio.topcoder.com/forums"
79+
export GRANT_FORUM_ACCESS=false
80+
export DEV_FORUM_JNDI=jnp://env.topcoder.com:1199
81+
82+
## The period for expiring the generated tokens for password resetting
83+
export RESET_PASSWORD_TOKEN_EMAIL_SUBJECT=TopCoder Account Password Reset
84+
# Set this to 180000 which is 3 mins. This will help saving time for test.
85+
export RESET_PASSWORD_TOKEN_CACHE_EXPIRY=180000
86+
87+
export REDIS_HOST=localhost
88+
export REDIS_PORT=6379
89+
90+
export DEVELOP_SUBMISSION_MAX_SIZE=6144
91+
92+
export WATERMARK_FILE_PATH=test/test_files/design_image_file_generator/studio_logo_watermark.png
93+
94+
export WKHTMLTOIMAGE_COMMAND_PATH=/home/ubuntu/tmp/wkhtmltox-0.12.1/static-build/posix-local/wkhtmltox-0.12.1/bin/wkhtmltoimage
95+
export WKHTMLTOIMAGE_IMAGE_WIDTH=1024
96+
export HIGHLIGHT_STYLE_LINK=http://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.3/styles/%OVERRIDE_STYLE_NAME%.min.css
97+
98+
export JWT_TOKEN_COOKIE_KEY="tcjwt_vm"
99+
100+
export ADMIN_API_KEY=1234567

local/node/Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM node:0.10
2+
3+
COPY jdk-8u51-linux-x64.gz /opt
4+
5+
RUN cd /opt && \
6+
tar -xvf jdk-8u51-linux-x64.gz && \
7+
cd /usr/bin && \
8+
ln -s /opt/jdk1.8.0_51/bin/java java && \
9+
ln -s /opt/jdk1.8.0_51/bin/javac javac
10+
11+
ENV JAVA_HOME=/opt/jdk1.8.0_51
12+
13+
RUN npm install -g java
14+
15+
RUN apt-get install -y net-tools psmisc

queries/get_top_members_data

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
SELECT
2-
FIRST @pageSize@
2+
SKIP @firstRowIndex@
3+
FIRST @pageSize@
34
c.coder_id AS user_id
45
, handle
56
, rating

0 commit comments

Comments
 (0)